﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace PoeThing
{
    public partial class FormSmall : Form
    {
        string FileName = @"..\..\defaultchar.bin";
        decimal decTemp;
        PoeChar myChar;
        public FormSmall()
        {
            InitializeComponent();
            myChar = new PoeChar();
            fillFormFromFile();
        }
        public FormSmall(string file)
        {
            InitializeComponent();
            myChar = new PoeChar();
            txtFile.Text = file;
            openCharFile(file);
        }
        //SHARED FUNCTIONS
        
        private string isIntOrZero(string testval)
        {
            int returnval;
            if (int.TryParse(testval, out returnval))
                return Convert.ToString(returnval);
            else
                return "0";
        }

        // checks to see if the Text in the passed TextBox can be converted to a decimal
        // if so, convert it and set the value outD to that value, otherwise 
        // clear the TextBox and set outD to 0
        private void decCheckBox(TextBox tbTemp, out decimal outD)
        {
            if (tbTemp.Text.Trim().Length != 0) // if there's something in the cell
            {
                if (Decimal.TryParse(tbTemp.Text, out decTemp))
                    outD = Convert.ToDecimal(tbTemp.Text);
                else
                {
                    tbTemp.Clear();
                    outD = 0;
                }
            }
            else
                outD = 0;
        }

        //HEADER FUNCTIONS
        private void btNewChar_Click(object sender, EventArgs e)
        {
            myChar = new PoeChar();
            fillFormFromFile();
        }

        private void openCharFile(string fn)
        {
            FileName = @"..\..\" + fn + ".bin";
            if (File.Exists(FileName))
            {
                Stream TestFileStream = File.OpenRead(FileName);
                BinaryFormatter deserializer = new BinaryFormatter();
                myChar = (PoeChar)deserializer.Deserialize(TestFileStream);
                TestFileStream.Close();
                MessageBox.Show("File " + FileName + " read!");
                fillFormFromFile();
            }
            else
                MessageBox.Show(FileName + " does not exist!");
        }
        private void bOpenFile_Click(object sender, EventArgs e)
        {
            /*
            FileName = @"..\..\" + txtFile.Text + ".bin";
            if (File.Exists(FileName))
            {
                Stream TestFileStream = File.OpenRead(FileName);
                BinaryFormatter deserializer = new BinaryFormatter();
                myChar = (PoeChar)deserializer.Deserialize(TestFileStream);
                TestFileStream.Close();
                MessageBox.Show("File " + FileName + " read!");
                fillFormFromFile();
            }
            else
                MessageBox.Show(FileName+" does not exist!");*/
            openCharFile(txtFile.Text);
        }
        private void btSaveFile_Click(object sender, EventArgs e)
        {
            FileName = @"..\..\" + txtFile.Text + ".bin";
            if (File.Exists(FileName))
            {
                DialogResult dialogResult = MessageBox.Show(FileName + " already exists, overwrite?", "Overwrite?", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Stream TestFileStream = File.Create(FileName);
                    BinaryFormatter serializer = new BinaryFormatter();
                    serializer.Serialize(TestFileStream, myChar);
                    TestFileStream.Close();
                    MessageBox.Show("" + FileName + " saved!\n");
                }
            }
            else
            {
                Stream TestFileStream = File.Create(FileName);
                BinaryFormatter serializer = new BinaryFormatter();
                serializer.Serialize(TestFileStream, myChar);
                TestFileStream.Close();
                MessageBox.Show("" + FileName + " saved!\n");
            }
        }

        private void txtName_Leave(object sender, EventArgs e)
        {
            myChar.charName = txtName.Text;
        }
        private void cboClass_SelectedIndexChanged(object sender, EventArgs e)
        {
            myChar.changeClass(cboClass.Text);
            updateStr();
            updateDex();
            updateInt();
        }
        private void txtLvl_Leave(object sender, EventArgs e)
        {
            myChar.level = Convert.ToInt32(txtLvl.Text);
            myChar.baseEvade = 50+(myChar.level * 3);
            updateLife();
            updateMana();
            updateEvade();
        }

        private void chkCI_CheckedChanged(object sender, EventArgs e)
        {
            if (chkCI.Checked == true)
            {
                myChar.CI = 1;
                myChar.ESMore = 12;
            }
            else
            {
                myChar.CI = 0;
                myChar.ESMore = 0;
            }
            this.updateES();
            this.updateLife();
            this.updateResists();
        }

        private void chkIR_CheckedChanged(object sender, EventArgs e)
        {
            if (chkIR.Checked == true)
                myChar.IR = 1;
            else
                myChar.IR = 0;
            this.updateEvade();
        }

        private void chkEB_CheckedChanged(object sender, EventArgs e)
        {
            if (chkEB.Checked == true)
                myChar.EB = 1;
            else
                myChar.EB = 0;
            this.updateES();
            this.updateMana();
        }
        private void chkAC_CheckedChanged(object sender, EventArgs e)
        {
            if (chkAC.Checked == true)
                myChar.AC = 1;
            else
                myChar.AC = 0;
             this.updateArmor();
             this.updateES();
             if (myChar.EB == 1)
                 updateMana();
        }
        private void chkZO_CheckedChanged(object sender, EventArgs e)
        {
            if (chkZO.Checked == true)
                myChar.ZO = 1;
            else
                myChar.ZO = 0;
            this.updateReg();
            
        }
        private void chkBM_CheckedChanged(object sender, EventArgs e)
        {
            if (chkBM.Checked == true)
                myChar.BM = 1;
            else
                myChar.BM = 0;
             this.updateMana();
        }
        private void chkNA_CheckedChanged(object sender, EventArgs e)
        {
            if (chkNA.Checked == true)
                myChar.NA = 1;
            else
                myChar.NA = 0;
            // this.updateShield();
        }
        private void chkCruel_CheckedChanged(object sender, EventArgs e)
        {
            if (chkCruel.Checked == true)
                myChar.Cruel = 1;
            else
                myChar.Cruel = 0;
             this.updateResists();
        }
        private void chkMerc_CheckedChanged(object sender, EventArgs e)
        {
            if (chkMerc.Checked == true)
                myChar.Merc = 1;
            else
                myChar.Merc = 0;
             this.updateResists();
        }
        private void chkDW_CheckedChanged(object sender, EventArgs e)
        {
            if (chkDW.Checked == true)
                myChar.DW = 1;
            else
                myChar.DW = 0;
            this.updateShield();
            this.updateDPS();
        }

        private void chkRanged_CheckedChanged(object sender, EventArgs e)
        {
            if (chkRanged.Checked == true)
                myChar.Ranged = 1;
            else
                myChar.Ranged = 0;            
            this.updateDPS();
        }

        private void updateStr()
        {
            txtStrBase.Text = myChar.baseStr.ToString();
            txtStrGear.Text = myChar.strStrAddSum();
            txtStrTot.Text = txtFSStr.Text = myChar.strFinalStr();
            txtStatsPhys.Text = myChar.strStatsPhys();
            txtStatsLife.Text = myChar.strStatsLife();
            updateLife();
            updateDPS();

        }
        private void updateDex()
        {
            txtDexBase.Text = myChar.baseDex.ToString();
            txtDexGear.Text = myChar.strDexAddSum();
            txtDexTot.Text = txtFSDex.Text = myChar.strFinalDex();
            txtStatsEvade.Text = myChar.strStatsEvade();
            txtStatsAcc.Text = myChar.strStatsAcc();
            updateDPS();
        }
        private void updateInt()
        {
            txtIntBase.Text = myChar.baseInt.ToString();
            txtIntGear.Text = myChar.strIntAddSum();
            txtIntTot.Text = txtFSInt.Text = myChar.strFinalInt();
            txtStatsES.Text = myChar.strStatsES();
            txtStatsMana.Text = myChar.strStatsMana();
            updateMana();
            updateES();

        }
        //STATS BOX FUNCTIONS
        private void txtStrBase_TextChanged(object sender, EventArgs e)
        {
            txtStrBase.Text = isIntOrZero(txtStrBase.Text);
            myChar.baseStr = Convert.ToInt32(txtStrBase.Text);
            updateStr();
        }

        private void txtIntBase_TextChanged(object sender, EventArgs e)
        {
            txtIntBase.Text = isIntOrZero(txtIntBase.Text);
            myChar.baseInt = Convert.ToInt32(txtIntBase.Text);
            updateInt();
        }

        private void txtDexBase_TextChanged(object sender, EventArgs e)
        {
            txtDexBase.Text = isIntOrZero(txtDexBase.Text);
            myChar.baseDex = Convert.ToInt32(txtDexBase.Text);
            updateDex();
        }

        /* LIFE/MANA BOX FUNCTIONS*******************************************************************************
         * 
         */
        //LIFE-------------------------------------------------
        private void updateLife()
        {
            myChar.updateBaseLife();
            txtLifeBase.Text = myChar.strBaseLife();
            txtLifeAddGN.Text = myChar.strLifeAddSum();
            txtLifeIncGN.Text = myChar.strLifeAddPSum();
            txtLifeFinal.Text = txtFSLife.Text = myChar.strLifeFinal();            
            this.updateReg();
            this.refreshAllAuraText();
        }
        private void updateReg()
        {
            txtRegAddGN.Text = myChar.strRegAddSum();
            txtRegIncGN.Text = myChar.strRegAddPSum();
            txtRegOther.Text = myChar.strRegOther();
            txtRegFinal.Text = txtFSRegen.Text = myChar.strRegenFinal();
            txtESRegFinal.Text = txtFSESRegen.Text = myChar.strESRegenFinal();
        }

        //MANA-------------------------------------------------
        private void updateMana()
        {
            myChar.updateBaseMana();
            txtManaBase.Text = myChar.strBaseMana();
            txtManaAddGN.Text = myChar.strManaAddSum();
            txtManaIncGN.Text = myChar.strManaAddPSum();
            txtManaOther.Text = myChar.strManaEB(); 
            txtManaFinal.Text = txtFSMana.Text = myChar.strManaFinal();
            this.updateManaReg();
            this.refreshAllAuraText();
        }
        private void updateManaReg()
        {
            txtManaRegBase.Text = myChar.strBaseManaRegen();
            txtManaRegAddGN.Text = myChar.strManaRegAddSum();
            txtManaRegIncGN.Text = myChar.strManaRegAddPSum();
            txtManaRegOther.Text = myChar.strManaRegenOther();
            txtManaRegFinal.Text = txtFSManaRegen.Text = myChar.strManaRegenFinal();
        }        

        /* ARMOR/EVADE/ES BOX FUNCTIONS*******************************************************************************
         * 
         */
        private void updateArmor()
        {
            txtArmorBase.Text = myChar.baseArmor.ToString();
            txtArmorGN.Text = myChar.strArmorAddSum();
            txtArmorGNP.Text = myChar.strArmorAddPSum();
            txtArmPlusEva.Text = myChar.strArmorPlusEvade();
            txtArmorTotP.Text = myChar.strArmorTotalP();
            txtIronReflexes.Text = myChar.strIronReflexes();
            txtArmorAdj.Text = myChar.strArmorAdjusted();
            txtArmorMore.Text = myChar.strArmorMore();
            txtArmorFinal.Text = txtFSArmor.Text =  myChar.strArmorFinal();
        }
        private void updateEvade()
        {
            txtEvadeBase.Text = myChar.baseEvade.ToString();
            txtEvadeGN.Text = myChar.strEvadeAddSum();
            txtEvadeGNP.Text = myChar.strEvadeAddPSum();
            txtArmPlusEva.Text = myChar.strArmorPlusEvade();
            txtEvadeTotP.Text = myChar.strEvadeTotalP();
            txtGrace.Text = myChar.baseGrace.ToString();
            txtIronReflexes.Text = myChar.strIronReflexes();
            txtEvadeFinal.Text = txtFSEvade.Text =  myChar.strEvadeFinal();
            if(myChar.IR == 1 )
                this.updateArmor();
        }
        private void updateES()
        {
            txtESBase.Text = myChar.baseES.ToString();
            txtESGN.Text = myChar.strESAddSum();
            txtESGNP.Text = myChar.strESAddPSum();
            txtESDis.Text = myChar.strESDiscipline();
            txtESTotP.Text = myChar.strESTotalP();
            txtESAdj.Text = myChar.strEsAdjusted();
            txtESMore.Text = myChar.strESMore();
            txtESFinal.Text = txtFSES.Text =  myChar.strESFinal();
            if(myChar.EB == 1) 
                this.updateMana();
        }

        private void updateResists()
        {
            txtFireBase.Text = myChar.strResBase();
            txtColdBase.Text = myChar.strResBase();
            txtLightBase.Text = myChar.strResBase();
            txtChaosBase.Text = myChar.strResBase();
            txtFireNode.Text = myChar.FireAdd[10].ToString();
            txtColdNode.Text = myChar.ColdAdd[10].ToString();
            txtLightNode.Text = myChar.LightAdd[10].ToString();
            txtChaosNode.Text = myChar.ChaosAdd[10].ToString();
            txtFireGear.Text= myChar.strFireGearSum();
            txtColdGear.Text = myChar.strColdGearSum();
            txtLightGear.Text = myChar.strLightGearSum();
            txtFireCap.Text = myChar.strFireCap();
            txtColdCap.Text = myChar.strColdCap();
            txtLightCap.Text = myChar.strLightCap();
            txtChaosCap.Text = myChar.strChaosCap();
            txtFireTotal.Text = myChar.strFireTotal();
            txtColdTotal.Text = myChar.strColdTotal();
            txtLightTotal.Text = myChar.strLightTotal();
            txtChaosTotal.Text = myChar.strChaosAddSum();
            txtFireCapped.Text = txtFSFireRes.Text =  myChar.strFireCapped();
            txtColdCapped.Text = txtFSColdRes.Text = myChar.strColdCapped();
            txtLightCapped.Text = txtFSLightRes.Text =  myChar.strLightCapped();
            txtChaosCapped.Text = txtFSChaosRes.Text =  myChar.strChaosCapped();
            
        }
        // --- SHIELD BOX FUNCTIONS-----------------------
        private void updateShield()
        {
            myChar.calcShieldExtras();
            txtShieldAll.Text = myChar.bonusShieldAllP.ToString("0.0");
            txtShieldES.Text = myChar.bonusShieldESP.ToString("0.0");
            txtShieldBonusArm.Text = myChar.strExtraShieldArm();
            txtShieldBonusEva.Text = myChar.strExtraShieldEva();
            txtShieldBonusES.Text = myChar.strExtraShieldES();
            txtBlockGear.Text = myChar.strBlockGear();
            txtBlockNode.Text = myChar.strBlockNode();
            txtBlockTotal.Text = myChar.strBlockTotal();
            txtSpellBlock.Text = myChar.spellBlockAdd.Sum().ToString("0.0") + "%";
            txtFSBlock.Text = myChar.strBlockTotal();
            txtFSDodge.Text = myChar.strDodgeTotal();
            txtFSSpellBlock.Text = txtSpellBlock.Text;
            this.updateEvade();
            this.updateES();
        }


        private void txtShieldAll_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.bonusShieldAllP);
            this.updateShield();
        }

        private void txtShieldES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.bonusShieldESP);
            this.updateShield();
        }

        private void txtSpellBlock_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.spellBlockAdd[0]);
            this.updateShield();
        }
        // MISC BOX FUNCTIONS
        private void updateMisc()
        {
            txtMiscIIR.Text = myChar.IIRAdd.Sum().ToString()+"%";
            txtMiscIIQ.Text = myChar.IIQAdd.Sum().ToString() + "%";
            txtMiscMove.Text = myChar.moveAdd.Sum().ToString() + "%";
            txtMiscSkillDur.Text = myChar.skillDuration.Sum().ToString() + "%";
            txtMiscBuffDur.Text = myChar.buffDuration.Sum().ToString() + "%";
            txtMiscBuffStr.Text = myChar.buffStrength.Sum().ToString() + "%";
            txtMiscAuraRes.Text = myChar.reducedReserve.Sum().ToString() + "%";
            txtMiscAuraStr.Text = myChar.auraStrength.Sum().ToString() + "%";
            txtMiscMinDmg.Text = myChar.minionDamage.Sum().ToString() + "%";
            txtMiscMinLife.Text = myChar.minionLife.Sum().ToString() + "%";
            txtMiscMinSpd.Text = myChar.minionSpeed.Sum().ToString() + "%";
        }

        private void updateDPS()
        {
            decimal aps;
            if (myChar.DW == 0)
                aps = myChar.mainHAPS;
            else
                aps = myChar.decDWAPS();
            txtDPSAcc.Text = myChar.strAcc();
            txtDPSBaseAPS.Text = aps.ToString("0.00");
            txtDPSAtkSpeed.Text = myChar.strAttackSpeed();
            txtDPSAPS.Text = myChar.strAPS();
            txtDPSBaseCast.Text = myChar.strBaseCast();
            txtDPSCastSpeed.Text = myChar.strCastSpeed();
            txtDPSCastTime.Text = myChar.strCastTime();

            txtDPSBaseCritAtk.Text = myChar.strBaseCritAtk();
            txtDPSBaseCritSpell.Text = myChar.strBaseCritSpell();            
            txtDPSCritPAtk.Text = myChar.strCritPAtk();
            txtDPSCritPSpell.Text = myChar.strCritPSpell();
            txtDPSCritMPAtk.Text = myChar.strCritMAtk();
            txtDPSCritMPSpell.Text = myChar.strCritMSpell();
            txtDPSCritAtk.Text = myChar.strAtkCritChance();
            txtDPSCritSpell.Text = myChar.strSpellCritChance();
            txtDPSCritMAtk.Text = myChar.strAtkCritMult();
            txtDPSCritMSpell.Text = myChar.strSpellCritMult();         
            
        }
        //

        //============================================================================================
        //                                         STATS TAB 
        //============================================================================================
        // LIFE
        //
        private void gnHeadLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[0]);
            this.updateLife();         
        }
        private void gnChestLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[1]);
            this.updateLife();
        }
        private void gnMainHLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[2]); 
            this.updateLife();
        }
        private void gnOffHLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[3]); 
            this.updateLife();
        }
        private void gnGlovesLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[4]);
            this.updateLife();
        }
        private void gnBootsLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[5]);
            this.updateLife();
        }
        private void gnBeltLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[6]);
            this.updateLife();
        }
        private void gnRing1Life_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[7]);
            this.updateLife();
        }
        private void gnRing2Life_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[8]); 
            this.updateLife();
        }
        private void gnAmuLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[9]); 
            this.updateLife();
        }
        private void gnNodeLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAdd[10]);
            this.updateLife();
        }
        private void gnHeadLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[0]);
            this.updateLife();
        }
        private void gnChestLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[1]);
            this.updateLife();
        }
        private void gnMainHLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[2]);
            this.updateLife();
        }
        private void gnOffHLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[3]);
            this.updateLife();
        }
        private void gnGlovesLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[4]);
            this.updateLife();
        }
        private void gnBootsLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[5]);
            this.updateLife();
        }
        private void gnBeltLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[6]);
            this.updateLife();
        }
        private void gnRing1LifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[7]);
            this.updateLife();
        }
        private void gnRing2LifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[8]);
            this.updateLife();
        }
        private void gnAmuLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[9]);
            this.updateLife();
        }
        private void gnNodeLifeAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LifeAddP[10]);
            this.updateLife();
        }
        // REGEN
        //
        private void gnHeadReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[0]);
            this.updateReg();
        }

        private void gnChestReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[1]);
            this.updateReg();
        }

        private void gnMainHReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[2]);
            this.updateReg();
        }

        private void gnOffHReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[3]); 
            this.updateReg();
        }

        private void gnGlovesReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[4]);
            this.updateReg();        
        }

        private void gnBootsReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[5]);
            this.updateReg();
        }

        private void gnBeltReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[6]);
            this.updateReg();       
        }

        private void gnRing1Reg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[7]);
            this.updateReg();
        }

        private void gnRing2Reg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[8]);
            this.updateReg();
        }

        private void gnAmuReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[9]);
            this.updateReg();
        }

        private void gnNodeReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAdd[10]);
            this.updateReg();
        }

        private void gnHeadRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[0]);
            this.updateReg();
        }

        private void gnChestRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[1]);
            this.updateReg();
        }

        private void gnMainHRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[2]);
            this.updateReg();
        }

        private void gnOffHRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[3]);
            this.updateReg();
        }

        private void gnGlovesRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[4]);
            this.updateReg();
        }

        private void gnBootsRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[5]);
            this.updateReg();
        }

        private void gnBeltRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[6]);
            this.updateReg();
        }

        private void gnRing1RegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[7]);
            this.updateReg();
        }

        private void gnRing2RegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[8]);
            this.updateReg();
        }

        private void gnAmuRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[9]);
            this.updateReg();
        }

        private void gnNodeRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.RegAddP[10]);
            this.updateReg();
        }
        // MANA
        //
        private void gnHeadMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[0]);
            this.updateMana();
        }

        private void gnChestMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[1]);
            this.updateMana();
        }

        private void gnMainHMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[2]);
            this.updateMana();
        }

        private void gnOffHMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[3]);
            this.updateMana();
        }

        private void gnGlovesMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[4]);
            this.updateMana();
        }

        private void gnBootsMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[5]);
            this.updateMana();
        }

        private void gnBeltMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[6]);
            this.updateMana();
        }

        private void gnRing1Mana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[7]);
            this.updateMana();
        }

        private void gnRing2Mana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[8]);
            this.updateMana();
        }

        private void gnAmuMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[9]);
            this.updateMana();
        }
        private void gnNodeMana_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAdd[10]);
            this.updateMana();
        }

        private void gnHeadManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[0]);
            this.updateMana();
        }

        private void gnChestManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[1]);
            this.updateMana();
        }

        private void gnMainHManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[2]);
            this.updateMana();
        }

        private void gnOffHManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[3]);
            this.updateMana();
        }

        private void gnGlovesManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[4]);
            this.updateMana();
        }

        private void gnBootsManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[5]);
            this.updateMana();
        }

        private void gnBeltManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[6]);
            this.updateMana();
        }

        private void gnRing1ManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[7]);
            this.updateMana();
        }

        private void gnRing2ManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[8]);
            this.updateMana();
        }

        private void gnAmuManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[9]);
            this.updateMana();
        }

        private void gnNodeManaAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaAddP[10]);
            this.updateMana();
        }
        // MANA REGEN
        //
        private void gnHeadManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[0]);
            this.updateManaReg();
        }

        private void gnChestManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[1]);
            this.updateManaReg();
        }

        private void gnMainHManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[2]);
            this.updateManaReg();
        }

        private void gnOffHManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[3]);
            this.updateManaReg();
        }

        private void gnGlovesManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[4]);
            this.updateManaReg();
        }

        private void gnBootsManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[5]);
            this.updateManaReg();
        }

        private void gnBeltManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[6]);
            this.updateManaReg();
        }

        private void gnRing1ManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[7]);
            this.updateManaReg();
        }

        private void gnRing2ManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[8]);
            this.updateManaReg();
        }

        private void gnAmuManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[9]);
            this.updateManaReg();
        }

        private void gnNodeManaReg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAdd[10]);
            this.updateManaReg();
        }
        //MANA REGEN %
        private void gnHeadManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[0]);
            this.updateManaReg();
        }

        private void gnChestManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[1]);
            this.updateManaReg();
        }

        private void gnMainHManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[2]);
            this.updateManaReg();
        }

        private void gnOffHManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[3]);
            this.updateManaReg();
        }

        private void gnGlovesManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[4]);
            this.updateManaReg();
        }

        private void gnBootsManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[5]);
            this.updateManaReg();
        }

        private void gnBeltManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[6]);
            this.updateManaReg();
        }

        private void gnRing1ManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[7]);
            this.updateManaReg();
        }

        private void gnRing2ManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[8]);
            this.updateManaReg();
        }

        private void gnAmuManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[9]);
            this.updateManaReg();
        }

        private void gnNodeManaRegAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ManaRegAddP[10]);
            this.updateManaReg();
        }
        // STR +
        private void gnHeadStr_Leave(object sender, EventArgs e)
        {

            decCheckBox((TextBox)sender, out myChar.StrAdd[0]);
            this.updateStr();
        }

        private void gnChestStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[1]);
            this.updateStr();
        }

        private void gnMainHStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[2]);
            this.updateStr();
        }

        private void gnOffHStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[3]);
            this.updateStr();
        }

        private void gnGlovesStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[4]);
            this.updateStr();
        }

        private void gnBootsStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[5]);
            this.updateStr();
        }

        private void gnBeltStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[6]);
            this.updateStr();
        }

        private void gnRing1Str_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[7]);
            this.updateStr();
        }

        private void gnRing2Str_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[8]);
            this.updateStr();
        }

        private void gnAmuStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[9]);
            this.updateStr();
        }

        private void gnNodeStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAdd[10]);
            this.updateStr();
        }
        // STR %
        private void gnHeadStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[0]);
            this.updateStr();
        }

        private void gnChestStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[1]);
            this.updateStr();
        }

        private void gnMainHStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[2]);
            this.updateStr();
        }

        private void gnOffHStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[3]);
            this.updateStr();
        }

        private void gnGlovesStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[4]);
            this.updateStr();
        }

        private void gnBootsStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[5]);
            this.updateStr();
        }

        private void gnBeltStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[6]);
            this.updateStr();
        }

        private void gnRing1StrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[7]);
            this.updateStr();
        }

        private void gnRing2StrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[8]);
            this.updateStr();
        }

        private void gnAmuStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[9]);
            this.updateStr();
        }

        private void gnNodeStrP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.StrAddP[10]);
            this.updateStr();
        }
        // Dex +
        private void gnHeadDex_Leave(object sender, EventArgs e)
        {

            decCheckBox((TextBox)sender, out myChar.DexAdd[0]);
            this.updateDex();
        }

        private void gnChestDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[1]);
            this.updateDex();
        }

        private void gnMainHDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[2]);
            this.updateDex();
        }

        private void gnOffHDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[3]);
            this.updateDex();
        }

        private void gnGlovesDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[4]);
            this.updateDex();
        }

        private void gnBootsDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[5]);
            this.updateDex();
        }

        private void gnBeltDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[6]);
            this.updateDex();
        }

        private void gnRing1Dex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[7]);
            this.updateDex();
        }

        private void gnRing2Dex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[8]);
            this.updateDex();
        }

        private void gnAmuDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[9]);
            this.updateDex();
        }

        private void gnNodeDex_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAdd[10]);
            this.updateDex();
        }
        // Dex %
        private void gnHeadDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[0]);
            this.updateDex();
        }

        private void gnChestDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[1]);
            this.updateDex();
        }

        private void gnMainHDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[2]);
            this.updateDex();
        }

        private void gnOffHDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[3]);
            this.updateDex();
        }

        private void gnGlovesDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[4]);
            this.updateDex();
        }

        private void gnBootsDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[5]);
            this.updateDex();
        }

        private void gnBeltDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[6]);
            this.updateDex();
        }

        private void gnRing1DexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[7]);
            this.updateDex();
        }

        private void gnRing2DexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[8]);
            this.updateDex();
        }

        private void gnAmuDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[9]);
            this.updateDex();
        }

        private void gnNodeDexP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.DexAddP[10]);
            this.updateDex();
        }

        // Int +--------------------------------------------------------------
        private void gnHeadInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[0]);
            this.updateInt();
        }

        private void gnChestInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[1]);
            this.updateInt();
        }

        private void gnMainHInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[2]);
            this.updateInt();
        }

        private void gnOffHInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[3]);
            this.updateInt();
        }

        private void gnGlovesInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[4]);
            this.updateInt();
        }

        private void gnBootsInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[5]);
            this.updateInt();
        }

        private void gnBeltInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[6]);
            this.updateInt();
        }

        private void gnRing1Int_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[7]);
            this.updateInt();
        }

        private void gnRing2Int_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[8]);
            this.updateInt();
        }

        private void gnAmuInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[9]);
            this.updateInt();
        }

        private void gnNodeInt_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAdd[10]);
            this.updateInt();
        }
        // Int %--------------------------------------------------
        private void gnHeadIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[0]);
           this.updateInt();
        }

        private void gnChestIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[1]);
           this.updateInt();
        }

        private void gnMainHIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[2]);
           this.updateInt();
        }

        private void gnOffHIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[3]);
           this.updateInt();
        }

        private void gnGlovesIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[4]);
           this.updateInt();
        }

        private void gnBootsIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[5]);
           this.updateInt();
        }

        private void gnBeltIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[6]);
           this.updateInt();
        }

        private void gnRing1IntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[7]);
           this.updateInt();
        }

        private void gnRing2IntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[8]);
           this.updateInt();
        }

        private void gnAmuIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[9]);
           this.updateInt();
        }

        private void gnNodeIntP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IntAddP[10]);
           this.updateInt();
        }

        // MOVE --------------------------------------------------
        private void gnHeadMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[0]);
            this.updateMisc();
        }
        private void gnChestMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[1]);
            this.updateMisc();
        }
        private void gnMainHMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[2]);
            this.updateMisc();
        }

        private void gnOffHMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[3]);
            this.updateMisc();
        }

        private void gnGlovesMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[4]);
            this.updateMisc();
        }

        private void gnBootsMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[5]);
            this.updateMisc();
        }

        private void gnBeltMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[6]);
            this.updateMisc();
        }

        private void gnRing1Move_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[7]);
            this.updateMisc();
        }

        private void gnRing2Move_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[8]);
            this.updateMisc();
        }
        private void gnAmuMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[9]);
            this.updateMisc();
        }
        private void gnNodeMove_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.moveAdd[10]);
            this.updateMisc();
        }
        // CAST SPEED --------------------------------------------------
        private void gnHeadCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[0]);
            this.updateDPS();
        }
        private void gnChestCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[1]);
            this.updateDPS();
        }
        private void gnMainHCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[2]);
            this.updateDPS();
        }

        private void gnOffHCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[3]);
            this.updateDPS();
        }

        private void gnGlovesCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[4]);
            this.updateDPS();
        }

        private void gnBootsCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[5]);
            this.updateDPS();
        }

        private void gnBeltCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[6]);
            this.updateDPS();
        }

        private void gnRing1CastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[7]);
            this.updateDPS();
        }

        private void gnRing2CastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[8]);
            this.updateDPS();
        }
        private void gnAmuCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[9]);
            this.updateDPS();
        }
        private void gnNodeCastSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.castSpeed[10]);
            this.updateDPS();
        }
        // Attack SPEED --------------------------------------------------
        private void gnHeadAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[0]);
            this.updateDPS();
        }
        private void gnChestAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[1]);
            this.updateDPS();
        }
        private void gnMainHAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[2]);
            this.updateDPS();
        }

        private void gnOffHAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[3]);
            this.updateDPS();
        }

        private void gnGlovesAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[4]);
            this.updateDPS();
        }

        private void gnBootsAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[5]);
            this.updateDPS();
        }

        private void gnBeltAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[6]);
            this.updateDPS();
        }

        private void gnRing1AttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[7]);
            this.updateDPS();
        }

        private void gnRing2AttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[8]);
            this.updateDPS();
        }
        private void gnAmuAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[9]);
            this.updateDPS();
        }
        private void gnNodeAttackSpeed_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.attackSpeed[10]);
            this.updateDPS();
        }
        // Accuracy + --------------------------------------------------
        private void gnHeadAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[0]);
            this.updateDPS();
        }
        private void gnChestAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[1]);
            this.updateDPS();
        }
        private void gnMainHAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[2]);
            this.updateDPS();
        }

        private void gnOffHAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[3]);
            this.updateDPS();
        }

        private void gnGlovesAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[4]);
            this.updateDPS();
        }

        private void gnBootsAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[5]);
            this.updateDPS();
        }

        private void gnBeltAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[6]);
            this.updateDPS();
        }

        private void gnRing1AccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[7]);
            this.updateDPS();
        }

        private void gnRing2AccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[8]);
            this.updateDPS();
        }
        private void gnAmuAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[9]);
            this.updateDPS();
        }
        private void gnNodeAccAdd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAdd[10]);
            this.updateDPS();
        }
        // Accuracy % --------------------------------------------------
        private void gnHeadAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[0]);
            this.updateDPS();
        }
        private void gnChestAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[1]);
            this.updateDPS();
        }
        private void gnMainHAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[2]);
            this.updateDPS();
        }

        private void gnOffHAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[3]);
            this.updateDPS();
        }

        private void gnGlovesAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[4]);
            this.updateDPS();
        }

        private void gnBootsAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[5]);
            this.updateDPS();
        }

        private void gnBeltAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[6]);
            this.updateDPS();
        }

        private void gnRing1AccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[7]);
            this.updateDPS();
        }

        private void gnRing2AccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[8]);
            this.updateDPS();
        }
        private void gnAmuAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[9]);
            this.updateDPS();
        }
        private void gnNodeAccAddP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.accAddP[10]);
            this.updateDPS();
        }       
        //============================================================================================
        //                                         DEFENSES TAB 
        //============================================================================================
        // Armor +--------------------------------------------------------------
        private void gnHeadArm_Leave(object sender, EventArgs e)
        {

            decCheckBox((TextBox)sender, out myChar.ArmorAdd[0]);
            this.updateArmor();
        }

        private void gnChestArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[1]);
            this.updateArmor();
        }

        private void gnMainHArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[2]);
            this.updateArmor();
        }

        private void gnOffHArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[3]);
            this.updateShield();
            this.updateArmor();
        }

        private void gnGlovesArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[4]);
            this.updateArmor();
        }

        private void gnBootsArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[5]);
            this.updateArmor();
        }

        private void gnBeltArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[6]);
            this.updateArmor();
        }

        private void gnRing1Arm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[7]);
            this.updateArmor();
        }

        private void gnRing2Arm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[8]);
            this.updateArmor();
        }

        private void gnAmuArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[9]);
            this.updateArmor();
        }

        private void gnNodeArm_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAdd[10]);
            this.updateArmor();
        }
        // Arm %--------------------------------------------------
        private void gnHeadArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[0]);
            this.updateArmor();
        }

        private void gnChestArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[1]);
            this.updateArmor();
        }

        private void gnMainHArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[2]);
            this.updateArmor();
        }

        private void gnOffHArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[3]);
            this.updateArmor();
        }

        private void gnGlovesArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[4]);
            this.updateArmor();
        }

        private void gnBootsArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[5]);
            this.updateArmor();
        }

        private void gnBeltArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[6]);
            this.updateArmor();
        }

        private void gnRing1ArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[7]);
            this.updateArmor();
        }

        private void gnRing2ArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[8]);
            this.updateArmor();
        }

        private void gnAmuArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[9]);
            this.updateArmor();
        }

        private void gnNodeArmP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorAddP[10]);
            this.updateArmor();
        }

        private void gnNodeArEv_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ArmorPlusEvade);
            this.updateArmor();
        }

        // Evade +--------------------------------------------------------------
        private void gnHeadEva_Leave(object sender, EventArgs e)
        {

            decCheckBox((TextBox)sender, out myChar.EvadeAdd[0]);
            this.updateEvade();
        }

        private void gnChestEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[1]);
            this.updateEvade();
        }

        private void gnMainHEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[2]);
            this.updateEvade();
        }

        private void gnOffHEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[3]);
            this.updateShield();
            this.updateEvade();
        }

        private void gnGlovesEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[4]);
            this.updateEvade();
        }

        private void gnBootsEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[5]);
            this.updateEvade();
        }

        private void gnBeltEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[6]);
            this.updateEvade();
        }

        private void gnRing1Eva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[7]);
            this.updateEvade();
        }

        private void gnRing2Eva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[8]);
            this.updateEvade();
        }

        private void gnAmuEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[9]);
            this.updateEvade();
        }

        private void gnNodeEva_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAdd[10]);
            this.updateEvade();
        }
        // Evade %--------------------------------------------------
        private void gnHeadEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[0]);
            this.updateEvade();
        }

        private void gnChestEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[1]);
            this.updateEvade();
        }

        private void gnMainHEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[2]);
            this.updateEvade();
        }

        private void gnOffHEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[3]);
            this.updateEvade();
        }

        private void gnGlovesEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[4]);
            this.updateEvade();
        }

        private void gnBootsEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[5]);
            this.updateEvade();
        }

        private void gnBeltEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[6]);
            this.updateEvade();
        }

        private void gnRing1EvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[7]);
            this.updateEvade();
        }

        private void gnRing2EvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[8]);
            this.updateEvade();
        }

        private void gnAmuEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[9]);
            this.updateEvade();
        }

        private void gnNodeEvaP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.EvadeAddP[10]);
            this.updateEvade();
        }

        // ES +--------------------------------------------------------------
        private void gnHeadES_Leave(object sender, EventArgs e)
        {

            decCheckBox((TextBox)sender, out myChar.ESAdd[0]);
            this.updateES();
        }

        private void gnChestES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[1]);
            this.updateES();
        }

        private void gnMainHES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[2]);
            this.updateES();
        }

        private void gnOffHES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[3]);
            this.updateShield();
            this.updateES();
        }

        private void gnGlovesES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[4]);
            this.updateES();
        }

        private void gnBootsES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[5]);
            this.updateES();
        }

        private void gnBeltES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[6]);
            this.updateES();
        }

        private void gnRing1ES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[7]);
            this.updateES();
        }

        private void gnRing2ES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[8]);
            this.updateES();
        }

        private void gnAmuES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[9]);
            this.updateES();
        }

        private void gnNodeES_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAdd[10]);
            this.updateES();
        }
        // ES %--------------------------------------------------
        private void gnHeadESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[0]);
            this.updateES();
        }

        private void gnChestESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[1]);
            this.updateES();
        }

        private void gnMainHESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[2]);
            this.updateES();
        }

        private void gnOffHESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[3]);
            this.updateES();
        }

        private void gnGlovesESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[4]);
            this.updateES();
        }

        private void gnBootsESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[5]);
            this.updateES();
        }

        private void gnBeltESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[6]);
            this.updateES();
        }

        private void gnRing1ESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[7]);
            this.updateES();
        }

        private void gnRing2ESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[8]);
            this.updateES();
        }

        private void gnAmuESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[9]);
            this.updateES();
        }

        private void gnNodeESP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ESAddP[10]);
            this.updateES();
        }
        // BLOCK & DODGE
        private void gnHeadBlock_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.blockAdd[0]);
            this.updateShield();
        }
        private void gnOffHBlock_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.blockAdd[3]);
            this.updateShield();
        }
        private void gnAmuBlock_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.blockAdd[9]);
            this.updateShield();
        }
        private void gnNodeBlock_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.blockAdd[10]);
            this.updateShield();
        }

        private void gnChestDodge_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dodgeAdd[1]);
            this.updateShield();
        }
        private void gnBootsDodge_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dodgeAdd[5]);
            this.updateShield();
        }
        private void gnNodeDodge_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dodgeAdd[10]);
            this.updateShield();
        }
        // FIRE RES --------------------------------------------------
        private void gnHeadResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[0]);
            this.updateResists();
        }

        private void gnChestResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[1]);
            this.updateResists();
        }

        private void gnMainHResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[2]);
            this.updateResists();
        }

        private void gnOffHResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[3]);
            this.updateResists();
        }

        private void gnGlovesResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[4]);
            this.updateResists();
        }

        private void gnBootsResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[5]);
            this.updateResists();
        }

        private void gnBeltResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[6]);
            this.updateResists();
        }

        private void gnRing1ResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[7]);
            this.updateResists();
        }

        private void gnRing2ResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[8]);
            this.updateResists();
        }

        private void gnAmuResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[9]);
            this.updateResists();
        }

        private void gnNodeResFire_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireAdd[10]);
            this.updateResists();
        }
        
        // MAX FIRE RES --------------------------------------------------
        private void gnHeadResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[0]);
            this.updateResists();
        }

        private void gnChestResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[1]);
            this.updateResists();
        }

        private void gnMainHResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[2]);
            this.updateResists();
        }

        private void gnOffHResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[3]);
            this.updateResists();
        }

        private void gnGlovesResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[4]);
            this.updateResists();
        }

        private void gnBootsResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[5]);
            this.updateResists();
        }

        private void gnBeltResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[6]);
            this.updateResists();
        }

        private void gnRing1ResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[7]);
            this.updateResists();
        }

        private void gnRing2ResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[8]);
            this.updateResists();
        }

        private void gnAmuResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[9]);
            this.updateResists();
        }

        private void gnNodeResFireMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.FireMaxAdd[10]);
            this.updateResists();
        }

        // Cold RES --------------------------------------------------
        private void gnHeadResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[0]);
            this.updateResists();
        }

        private void gnChestResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[1]);
            this.updateResists();
        }

        private void gnMainHResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[2]);
            this.updateResists();
        }

        private void gnOffHResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[3]);
            this.updateResists();
        }

        private void gnGlovesResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[4]);
            this.updateResists();
        }

        private void gnBootsResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[5]);
            this.updateResists();
        }

        private void gnBeltResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[6]);
            this.updateResists();
        }

        private void gnRing1ResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[7]);
            this.updateResists();
        }

        private void gnRing2ResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[8]);
            this.updateResists();
        }

        private void gnAmuResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[9]);
            this.updateResists();
        }

        private void gnNodeResCold_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdAdd[10]);
            this.updateResists();
        }

        // MAX Cold RES --------------------------------------------------
        private void gnHeadResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[0]);
            this.updateResists();
        }

        private void gnChestResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[1]);
            this.updateResists();
        }

        private void gnMainHResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[2]);
            this.updateResists();
        }

        private void gnOffHResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[3]);
            this.updateResists();
        }

        private void gnGlovesResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[4]);
            this.updateResists();
        }

        private void gnBootsResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[5]);
            this.updateResists();
        }

        private void gnBeltResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[6]);
            this.updateResists();
        }

        private void gnRing1ResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[7]);
            this.updateResists();
        }

        private void gnRing2ResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[8]);
            this.updateResists();
        }

        private void gnAmuResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[9]);
            this.updateResists();
        }

        private void gnNodeResColdMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ColdMaxAdd[10]);
            this.updateResists();
        }

        // Light RES --------------------------------------------------
        private void gnHeadResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[0]);
            this.updateResists();
        }

        private void gnChestResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[1]);
            this.updateResists();
        }

        private void gnMainHResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[2]);
            this.updateResists();
        }

        private void gnOffHResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[3]);
            this.updateResists();
        }

        private void gnGlovesResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[4]);
            this.updateResists();
        }

        private void gnBootsResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[5]);
            this.updateResists();
        }

        private void gnBeltResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[6]);
            this.updateResists();
        }

        private void gnRing1ResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[7]);
            this.updateResists();
        }

        private void gnRing2ResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[8]);
            this.updateResists();
        }

        private void gnAmuResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[9]);
            this.updateResists();
        }

        private void gnNodeResLight_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightAdd[10]);
            this.updateResists();
        }

        // MAX Light RES --------------------------------------------------
        private void gnHeadResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[0]);
            this.updateResists();
        }

        private void gnChestResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[1]);
            this.updateResists();
        }

        private void gnMainHResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[2]);
            this.updateResists();
        }

        private void gnOffHResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[3]);
            this.updateResists();
        }

        private void gnGlovesResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[4]);
            this.updateResists();
        }

        private void gnBootsResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[5]);
            this.updateResists();
        }

        private void gnBeltResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[6]);
            this.updateResists();
        }

        private void gnRing1ResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[7]);
            this.updateResists();
        }

        private void gnRing2ResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[8]);
            this.updateResists();
        }

        private void gnAmuResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[9]);
            this.updateResists();
        }

        private void gnNodeResLightMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.LightMaxAdd[10]);
            this.updateResists();
        }
        // Chaos RES --------------------------------------------------
        private void gnHeadResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[0]);
            this.updateResists();
        }

        private void gnChestResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[1]);
            this.updateResists();
        }

        private void gnMainHResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[2]);
            this.updateResists();
        }

        private void gnOffHResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[3]);
            this.updateResists();
        }

        private void gnGlovesResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[4]);
            this.updateResists();
        }

        private void gnBootsResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[5]);
            this.updateResists();
        }

        private void gnBeltResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[6]);
            this.updateResists();
        }

        private void gnRing1ResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[7]);
            this.updateResists();
        }

        private void gnRing2ResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[8]);
            this.updateResists();
        }

        private void gnAmuResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[9]);
            this.updateResists();
        }

        private void gnNodeResChaos_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.ChaosAdd[10]);
            this.updateResists();
        }
        //============================================================================================
        //                                         OFFENSE TAB 
        //============================================================================================


        // Increased Phys
        private void gnHeadPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[0]);
            this.updateDPS();
        }

        private void gnChestPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[1]);
            this.updateDPS();
        }

        private void gnMainHPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[2]);
            this.updateDPS();
        }

        private void gnOffHPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[3]);
            this.updateDPS();
        }

        private void gnGlovesPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[4]);
            this.updateDPS();
        }

        private void gnBootsPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[5]);
            this.updateDPS();
        }

        private void gnBeltPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[6]);
            this.updateDPS();
        }

        private void gnRing1PhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[7]);
            this.updateDPS();
        }

        private void gnRing2PhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[8]);
            this.updateDPS();
        }

        private void gnAmuPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[9]);
            this.updateDPS();
        }

        private void gnNodePhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysP[10]);
            this.updateDPS();
        }

        // Increased Spell Damage
        private void gnHeadSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[0]);
            this.updateDPS();
        }

        private void gnChestSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[1]);
            this.updateDPS();
        }

        private void gnMainHSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[2]);
            this.updateDPS();
        }

        private void gnOffHSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[3]);
            this.updateDPS();
        }

        private void gnGlovesSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[4]);
            this.updateDPS();
        }

        private void gnBootsSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[5]);
            this.updateDPS();
        }

        private void gnBeltSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[6]);
            this.updateDPS();
        }

        private void gnRing1SpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[7]);
            this.updateDPS();
        }

        private void gnRing2SpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[8]);
            this.updateDPS();
        }

        private void gnAmuSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[9]);
            this.updateDPS();
        }

        private void gnNodeSpellDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgSpellP[10]);
            this.updateDPS();
        }
        
        // melee phys, phys by weapon type, projectile
        private void gnNodeMeleePhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgMeleePhysP[10]);
            this.updateDPS();
        }
        private void gnNodeWeapPhysP_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgWeapPhysP[10]);
            this.updateDPS();
        }
        private void gnNodeProjDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgProjP[10]);
            this.updateDPS();
        }


        // Increased Elem Damage
        private void gnHeadElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[0]);
            this.updateDPS();
        }

        private void gnChestElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[1]);
            this.updateDPS();
        }

        private void gnMainHElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[2]);
            this.updateDPS();
        }

        private void gnOffHElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[3]);
            this.updateDPS();
        }

        private void gnGlovesElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[4]);
            this.updateDPS();
        }

        private void gnBootsElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[5]);
            this.updateDPS();
        }

        private void gnBeltElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[6]);
            this.updateDPS();
        }

        private void gnRing1ElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[7]);
            this.updateDPS();
        }

        private void gnRing2ElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[8]);
            this.updateDPS();
        }

        private void gnAmuElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[9]);
            this.updateDPS();
        }

        private void gnNodeElemDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgElemP[10]);
            this.updateDPS();
        }

        // Increased Fire Damage
        private void gnHeadFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[0]);
            this.updateDPS();
        }

        private void gnChestFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[1]);
            this.updateDPS();
        }

        private void gnMainHFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[2]);
            this.updateDPS();
        }

        private void gnOffHFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[3]);
            this.updateDPS();
        }

        private void gnGlovesFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[4]);
            this.updateDPS();
        }

        private void gnBootsFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[5]);
            this.updateDPS();
        }

        private void gnBeltFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[6]);
            this.updateDPS();
        }

        private void gnRing1FireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[7]);
            this.updateDPS();
        }

        private void gnRing2FireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[8]);
            this.updateDPS();
        }

        private void gnAmuFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[9]);
            this.updateDPS();
        }

        private void gnNodeFireDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireP[10]);
            this.updateDPS();
        }

        // Increased Cold Damage
        private void gnHeadColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[0]);
            this.updateDPS();
        }

        private void gnChestColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[1]);
            this.updateDPS();
        }

        private void gnMainHColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[2]);
            this.updateDPS();
        }

        private void gnOffHColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[3]);
            this.updateDPS();
        }

        private void gnGlovesColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[4]);
            this.updateDPS();
        }

        private void gnBootsColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[5]);
            this.updateDPS();
        }

        private void gnBeltColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[6]);
            this.updateDPS();
        }

        private void gnRing1ColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[7]);
            this.updateDPS();
        }

        private void gnRing2ColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[8]);
            this.updateDPS();
        }

        private void gnAmuColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[9]);
            this.updateDPS();
        }

        private void gnNodeColdDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdP[10]);
            this.updateDPS();
        }
        // Increased Light Damage
        private void gnHeadLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[0]);
            this.updateDPS();
        }

        private void gnChestLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[1]);
            this.updateDPS();
        }

        private void gnMainHLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[2]);
            this.updateDPS();
        }

        private void gnOffHLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[3]);
            this.updateDPS();
        }

        private void gnGlovesLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[4]);
            this.updateDPS();
        }

        private void gnBootsLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[5]);
            this.updateDPS();
        }

        private void gnBeltLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[6]);
            this.updateDPS();
        }

        private void gnRing1LightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[7]);
            this.updateDPS();
        }

        private void gnRing2LightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[8]);
            this.updateDPS();
        }

        private void gnAmuLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[9]);
            this.updateDPS();
        }

        private void gnNodeLightDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightP[10]);
            this.updateDPS();
        }
        // Increased Chaos Damage
        private void gnHeadChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[0]);
            this.updateDPS();
        }

        private void gnChestChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[1]);
            this.updateDPS();
        }

        private void gnMainHChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[2]);
            this.updateDPS();
        }

        private void gnOffHChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[3]);
            this.updateDPS();
        }

        private void gnGlovesChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[4]);
            this.updateDPS();
        }

        private void gnBootsChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[5]);
            this.updateDPS();
        }

        private void gnBeltChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[6]);
            this.updateDPS();
        }

        private void gnRing1ChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[7]);
            this.updateDPS();
        }

        private void gnRing2ChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[8]);
            this.updateDPS();
        }

        private void gnAmuChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[9]);
            this.updateDPS();
        }

        private void gnNodeChaosDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosP[10]);
            this.updateDPS();
        }
        //ADDED DAMAGE
        // phys min
        private void gnHeadPhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[0]);
            this.updateDPS();
        }

        private void gnChestPhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[1]);
            this.updateDPS();
        }

        private void gnGlovesPhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[4]);
            this.updateDPS();
        }

        private void gnBootsPhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[5]);
            this.updateDPS();
        }

        private void gnBeltPhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[6]);
            this.updateDPS();
        }

        private void gnRing1PhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[7]);
            this.updateDPS();
        }

        private void gnRing2PhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[8]);
            this.updateDPS();
        }

        private void gnAmuPhysAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMin[9]);
            this.updateDPS();
        }

        // Phys Max
        private void gnHeadPhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[0]);
            this.updateDPS();
        }

        private void gnChestPhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[1]);
            this.updateDPS();
        }

        private void gnGlovesPhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[4]);
            this.updateDPS();
        }

        private void gnBootsPhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[5]);
            this.updateDPS();
        }

        private void gnBeltPhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[6]);
            this.updateDPS();
        }

        private void gnRing1PhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[7]);
            this.updateDPS();
        }

        private void gnRing2PhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[8]);
            this.updateDPS();
        }

        private void gnAmuPhysAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgPhysAddMax[9]);
            this.updateDPS();
        }

        // Fire Min
        private void gnHeadFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[0]);
            this.updateDPS();
        }

        private void gnChestFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[1]);
            this.updateDPS();
        }

        private void gnMainHFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[2]);
            this.updateDPS();
        }

        private void gnOffHFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[3]);
            this.updateDPS();
        }

        private void gnGlovesFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[4]);
            this.updateDPS();
        }

        private void gnBootsFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[5]);
            this.updateDPS();
        }

        private void gnBeltFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[6]);
            this.updateDPS();
        }

        private void gnRing1FireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[7]);
            this.updateDPS();
        }

        private void gnRing2FireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[8]);
            this.updateDPS();
        }

        private void gnAmuFireAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMin[9]);
            this.updateDPS();
        }
        // Fire Max
        private void gnHeadFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[0]);
            this.updateDPS();
        }

        private void gnChestFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[1]);
            this.updateDPS();
        }

        private void gnMainHFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[2]);
            this.updateDPS();
        }

        private void gnOffHFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[3]);
            this.updateDPS();
        }

        private void gnGlovesFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[4]);
            this.updateDPS();
        }

        private void gnBootsFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[5]);
            this.updateDPS();
        }

        private void gnBeltFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[6]);
            this.updateDPS();
        }

        private void gnRing1FireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[7]);
            this.updateDPS();
        }

        private void gnRing2FireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[8]);
            this.updateDPS();
        }

        private void gnAmuFireAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgFireAddMax[9]);
            this.updateDPS();
        }
        // Cold Min
        private void gnHeadColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[0]);
            this.updateDPS();
        }

        private void gnChestColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[1]);
            this.updateDPS();
        }

        private void gnMainHColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[2]);
            this.updateDPS();
        }

        private void gnOffHColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[3]);
            this.updateDPS();
        }

        private void gnGlovesColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[4]);
            this.updateDPS();
        }

        private void gnBootsColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[5]);
            this.updateDPS();
        }

        private void gnBeltColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[6]);
            this.updateDPS();
        }

        private void gnRing1ColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[7]);
            this.updateDPS();
        }

        private void gnRing2ColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[8]);
            this.updateDPS();
        }

        private void gnAmuColdAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMin[9]);
            this.updateDPS();
        }
        // Cold Max
        private void gnHeadColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[0]);
            this.updateDPS();
        }

        private void gnChestColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[1]);
            this.updateDPS();
        }

        private void gnMainHColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[2]);
            this.updateDPS();
        }

        private void gnOffHColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[3]);
            this.updateDPS();
        }

        private void gnGlovesColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[4]);
            this.updateDPS();
        }

        private void gnBootsColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[5]);
            this.updateDPS();
        }

        private void gnBeltColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[6]);
            this.updateDPS();
        }

        private void gnRing1ColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[7]);
            this.updateDPS();
        }

        private void gnRing2ColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[8]);
            this.updateDPS();
        }

        private void gnAmuColdAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgColdAddMax[9]);
            this.updateDPS();
        }
        // Light Min
        private void gnHeadLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[0]);
            this.updateDPS();
        }

        private void gnChestLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[1]);
            this.updateDPS();
        }

        private void gnMainHLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[2]);
            this.updateDPS();
        }

        private void gnOffHLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[3]);
            this.updateDPS();
        }

        private void gnGlovesLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[4]);
            this.updateDPS();
        }

        private void gnBootsLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[5]);
            this.updateDPS();
        }

        private void gnBeltLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[6]);
            this.updateDPS();
        }

        private void gnRing1LightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[7]);
            this.updateDPS();
        }

        private void gnRing2LightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[8]);
            this.updateDPS();
        }

        private void gnAmuLightAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMin[9]);
            this.updateDPS();
        }
        // Light Max
        private void gnHeadLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[0]);
            this.updateDPS();
        }

        private void gnChestLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[1]);
            this.updateDPS();
        }

        private void gnMainHLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[2]);
            this.updateDPS();
        }

        private void gnOffHLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[3]);
            this.updateDPS();
        }

        private void gnGlovesLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[4]);
            this.updateDPS();
        }

        private void gnBootsLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[5]);
            this.updateDPS();
        }

        private void gnBeltLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[6]);
            this.updateDPS();
        }

        private void gnRing1LightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[7]);
            this.updateDPS();
        }

        private void gnRing2LightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[8]);
            this.updateDPS();
        }

        private void gnAmuLightAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgLightAddMax[9]);
            this.updateDPS();
        }
        // Chaos Min
        private void gnHeadChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[0]);
            this.updateDPS();
        }

        private void gnChestChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[1]);
            this.updateDPS();
        }

        private void gnMainHChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[2]);
            this.updateDPS();
        }

        private void gnOffHChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[3]);
            this.updateDPS();
        }

        private void gnGlovesChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[4]);
            this.updateDPS();
        }

        private void gnBootsChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[5]);
            this.updateDPS();
        }

        private void gnBeltChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[6]);
            this.updateDPS();
        }

        private void gnRing1ChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[7]);
            this.updateDPS();
        }

        private void gnRing2ChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[8]);
            this.updateDPS();
        }

        private void gnAmuChaosAddMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMin[9]);
            this.updateDPS();
        }
        // Chaos Max
        private void gnHeadChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[0]);
            this.updateDPS();
        }

        private void gnChestChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[1]);
            this.updateDPS();
        }

        private void gnMainHChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[2]);
            this.updateDPS();
        }

        private void gnOffHChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[3]);
            this.updateDPS();
        }

        private void gnGlovesChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[4]);
            this.updateDPS();
        }

        private void gnBootsChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[5]);
            this.updateDPS();
        }

        private void gnBeltChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[6]);
            this.updateDPS();
        }

        private void gnRing1ChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[7]);
            this.updateDPS();
        }

        private void gnRing2ChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[8]);
            this.updateDPS();
        }

        private void gnAmuChaosAddMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dmgChaosAddMax[9]);
            this.updateDPS();
        }
  

        // WEAPON SPECIFIC
        private void txtmainHAPS_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.mainHAPS);
            this.updateDPS();
        }
        private void txtMainHPhysMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.mainHPhysMin);
            this.updateDPS();
        }
        private void txtOffHPhysMin_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.offHPhysMin);
            this.updateDPS();
        }
        private void txtMainHPhysMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.mainHPhysMax);
            this.updateDPS();
        }
        private void txtOffHPhysMax_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.offHPhysMax);
            this.updateDPS();
        }

        private void txtoffHAPS_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.offHAPS);
            this.updateDPS();
        }
        private void txtmainHCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.mainHCrit);
            this.updateDPS();
        }
        private void txtoffHCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.offHCrit);
            this.updateDPS();
        }

        //MISC DMG
        private void txtFacebreaker_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.facebreaker);
            this.updateDPS();
        }

        private void txtIgniteChance_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.igniteChance);
            //this.updateDPS();
        }

        private void txtIgniteDuration_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.igniteDuration);
            //this.updateDPS();
        }
        private void txtBurningDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.igniteDamage);
            //this.updateDPS();
        }
        private void txtShockChance_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.shockChance);
            //this.updateDPS();
        }
        private void txtShockDuration_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.shockDuration);
            //this.updateDPS();
        }
        private void txtFreezeChance_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.freezeChance);
            //this.updateDPS();
        }
        private void txtFreezeDuration_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.freezeDuration);
            //this.updateDPS();
        }
        private void txtChillDuration_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.chillDuration);
            //this.updateDPS();
        }
        private void txtDOTDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.dotDamage);
            //this.updateDPS();
        }
        private void txtTrapDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.trapDamage);
            //this.updateDPS();
        }

        private void txtAreaSize_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.areaSize);
            //this.updateDPS();
        }
        private void txtAreaDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.areaDamage);
            //this.updateDPS();
        }

        //============================================================================================
        //                                         MISC TAB 
        //============================================================================================
        // IIR --------------------------------------------------
        private void gnHeadIIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[0]);
            this.updateMisc();
        }
        private void gnMainHIIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[2]);
            this.updateMisc();
        }

        private void gnOffHIIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[3]);
            this.updateMisc();
        }

        private void gnGlovesIIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[4]);
            this.updateMisc();
        }

        private void gnBootsIIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[5]);
            this.updateMisc();
        }

        private void gnBeltIIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[6]);
            this.updateMisc();
        }

        private void gnRing1IIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[7]);
            this.updateMisc();
        }

        private void gnRing2IIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[8]);
            this.updateMisc();
        }

        private void gnAmuIIR_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIRAdd[9]);
            this.updateMisc();
        }
        // IIQ --------------------------------------------------
        private void gnHeadIIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[0]);
            this.updateMisc();
        }
        private void gnMainHIIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[2]);
            this.updateMisc();
        }

        private void gnOffHIIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[3]);
            this.updateMisc();
        }

        private void gnGlovesIIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[4]);
            this.updateMisc();
        }

        private void gnBootsIIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[5]);
            this.updateMisc();
        }

        private void gnBeltIIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[6]);
            this.updateMisc();
        }

        private void gnRing1IIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[7]);
            this.updateMisc();
        }

        private void gnRing2IIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[8]);
            this.updateMisc();
        }

        private void gnAmuIIQ_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.IIQAdd[9]);
            this.updateMisc();
        }


        // AURA RESERVE----------------------------------------------
        private void gnHeadAuraRes_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.reducedReserve[0]);
            this.updateMisc();
            this.refreshAllAuraText();
        }
        private void gnNodeAuraRes_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.reducedReserve[10]);
            this.updateMisc();
            this.refreshAllAuraText();
        }
        // AURA Strength----------------------------------------------
        private void gnOffHAuraEff_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.auraStrength[3]);
            this.updateMisc();
            this.refreshAllAuraText();
        }
        private void gnNodeAuraEff_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.auraStrength[10]);
            this.updateMisc();
            this.refreshAllAuraText();
        }
        // BUFF STR
        private void gnNodeBuffStr_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.buffStrength[10]);
            this.updateMisc();
            this.refreshAllAuraText();
        }
        // BUFF DUR
        private void gnNodeBuffDur_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.buffDuration[10]);
            this.updateMisc();
        }
        // SKILL DUR
        private void gnNodeSkillDur_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.skillDuration[10]);
            this.updateMisc();
        }
        // MINIONS
        private void gnMainHMinLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionLife[2]);
            this.updateMisc();
        }
        private void gnOffHMinLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionLife[3]);
            this.updateMisc();
        }
        private void gnAmuMinLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionLife[9]);
            this.updateMisc();
        }
        private void gnNodeMinLife_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionLife[10]);
            this.updateMisc();
        }
        // MINION DAMAGE
        private void gnMainHMinDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionDamage[2]);
            this.updateMisc();
        }
        private void gnOffHMinDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionDamage[3]);
            this.updateMisc();
        }
        private void gnAmuMinDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionDamage[9]);
            this.updateMisc();
        }
        private void gnNodeMinDmg_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionDamage[10]);
            this.updateMisc();
        }
        // MINION SPEED
        private void gnMainHMinSpd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionSpeed[2]);
            this.updateMisc();
        }
        private void gnOffHMinSpd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionSpeed[3]);
            this.updateMisc();
        }
        private void gnAmuMinSpd_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.minionSpeed[9]);
            this.updateMisc();
        }
        // GLOBAL CRIT  -------------------------
        private void gnHeadCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[0]);
            this.updateDPS();
        }

        private void gnChestCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[1]);
            this.updateDPS();
        }

        private void gnMainHCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[2]);
            this.updateDPS();
        }

        private void gnOffHCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[3]);
            this.updateDPS();
        }

        private void gnGlovesCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[4]);
            this.updateDPS();
        }

        private void gnBootsCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[5]);
            this.updateDPS();
        }

        private void gnBeltCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[6]);
            this.updateDPS();
        }

        private void gnRing1Crit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[7]);
            this.updateDPS();
        }

        private void gnRing2Crit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[8]);
            this.updateDPS();
        }

        private void gnAmuCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[9]);
            this.updateDPS();
        }

        private void gnNodeCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critP[10]);
            this.updateDPS();
        }

        // GLOBAL CRIT  MULT-------------------------
        private void gnHeadCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[0]);
            this.updateDPS();
        }

        private void gnChestCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[1]);
            this.updateDPS();
        }

        private void gnMainHCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[2]);
            this.updateDPS();
        }

        private void gnOffHCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[3]);
            this.updateDPS();
        }

        private void gnGlovesCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[4]);
            this.updateDPS();
        }

        private void gnBootsCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[5]);
            this.updateDPS();
        }

        private void gnBeltCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[6]);
            this.updateDPS();
        }

        private void gnRing1CritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[7]);
            this.updateDPS();
        }

        private void gnRing2CritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[8]);
            this.updateDPS();
        }

        private void gnAmuCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[9]);
            this.updateDPS();
        }

        private void gnNodeCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultP[10]);
            this.updateDPS();
        }
        // SPELL CRIT  -------------------------
        private void gnHeadSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[0]);
            this.updateDPS();
        }

        private void gnChestSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[1]);
            this.updateDPS();
        }

        private void gnMainHSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[2]);
            this.updateDPS();
        }

        private void gnOffHSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[3]);
            this.updateDPS();
        }

        private void gnGlovesSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[4]);
            this.updateDPS();
        }

        private void gnBootsSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[5]);
            this.updateDPS();
        }

        private void gnBeltSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[6]);
            this.updateDPS();
        }

        private void gnRing1SpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[7]);
            this.updateDPS();
        }

        private void gnRing2SpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[8]);
            this.updateDPS();
        }

        private void gnAmuSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[9]);
            this.updateDPS();
        }

        private void gnNodeSpellCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critSpellP[10]);
            this.updateDPS();
        }
        // SPELL CRIT MULT  -------------------------
        private void gnHeadSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[0]);
            this.updateDPS();
        }

        private void gnChestSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[1]);
            this.updateDPS();
        }

        private void gnMainHSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[2]);
            this.updateDPS();
        }

        private void gnOffHSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[3]);
            this.updateDPS();
        }

        private void gnGlovesSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[4]);
            this.updateDPS();
        }

        private void gnBootsSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[5]);
            this.updateDPS();
        }

        private void gnBeltSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[6]);
            this.updateDPS();
        }

        private void gnRing1SpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[7]);
            this.updateDPS();
        }

        private void gnRing2SpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[8]);
            this.updateDPS();
        }

        private void gnAmuSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[9]);
            this.updateDPS();
        }

        private void gnNodeSpellCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultSpellP[10]);
            this.updateDPS();
        }
        // ATTACK CRIT  -------------------------
        private void gnHeadAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[0]);
            this.updateDPS();
        }

        private void gnChestAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[1]);
            this.updateDPS();
        }

        private void gnMainHAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[2]);
            this.updateDPS();
        }

        private void gnOffHAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[3]);
            this.updateDPS();
        }

        private void gnGlovesAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[4]);
            this.updateDPS();
        }

        private void gnBootsAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[5]);
            this.updateDPS();
        }

        private void gnBeltAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[6]);
            this.updateDPS();
        }

        private void gnRing1AtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[7]);
            this.updateDPS();
        }

        private void gnRing2AtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[8]);
            this.updateDPS();
        }

        private void gnAmuAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[9]);
            this.updateDPS();
        }

        private void gnNodeAtkCrit_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critWeaponP[10]);
            this.updateDPS();
        }
        // ATTACK CRIT MULT  -------------------------
        private void gnHeadAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[0]);
            this.updateDPS();
        }

        private void gnChestAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[1]);
            this.updateDPS();
        }

        private void gnMainHAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[2]);
            this.updateDPS();
        }

        private void gnOffHAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[3]);
            this.updateDPS();
        }

        private void gnGlovesAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[4]);
            this.updateDPS();
        }

        private void gnBootsAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[5]);
            this.updateDPS();
        }

        private void gnBeltAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[6]);
            this.updateDPS();
        }

        private void gnRing1AtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[7]);
            this.updateDPS();
        }

        private void gnRing2AtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[8]);
            this.updateDPS();
        }

        private void gnAmuAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[9]);
            this.updateDPS();
        }

        private void gnNodeAtkCritM_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.critMultWeaponP[10]);
            this.updateDPS();
        }
        //============================================================================================
        //                                         AURAS TAB 
        //============================================================================================
        //-----------------------------------------AURAS---------------------------------------------/
        // 0 = level, 1 = reduced amount, 2 = blood magic amount, 3=base cost%, 4 = eff1, 5 = eff2, 6 = eff3
        private void refreshAllAuraText()
        {
            // Need a way to update aura mana costs after mana/hp change without triggering everything else
            updateAuraAnger();
            updateAuraClarity("no");
            updateAuraDetermination("no");
            updateAuraDiscipline("no");
            updateAuraGrace("no");
            updateAuraHaste("no");
            updateAuraHatred("no");
            updateAuraPurity("no");
            updateAuraPurityofFire("no");
            updateAuraPurityofIce("no");
            updateAuraPurityofLightning("no");
            updateAuraVitality("no");
            updateAuraTempestShield("no");
        }
        private void updateAuraCosts()
        {
            decimal mana = 0, life = 0;            
            mana = mana + Convert.ToDecimal(txtAngMana.Text) + Convert.ToDecimal(txtClaMana.Text) + Convert.ToDecimal(txtDetMana.Text) +
                   Convert.ToDecimal(txtDisMana.Text) + Convert.ToDecimal(txtGraMana.Text) + Convert.ToDecimal(txtHasMana.Text) +
                   Convert.ToDecimal(txtHatMana.Text) + Convert.ToDecimal(txtPoEMana.Text) + Convert.ToDecimal(txtPoFMana.Text) +
                   Convert.ToDecimal(txtPoIMana.Text) + Convert.ToDecimal(txtPoLMana.Text) + Convert.ToDecimal(txtVitMana.Text) +
                   Convert.ToDecimal(txtTSMana.Text);
            life = life + Convert.ToDecimal(txtAngLife.Text) + Convert.ToDecimal(txtClaLife.Text) + Convert.ToDecimal(txtDetLife.Text) +
                   Convert.ToDecimal(txtDisLife.Text) + Convert.ToDecimal(txtGraLife.Text) + Convert.ToDecimal(txtHasLife.Text) +
                   Convert.ToDecimal(txtHatLife.Text) + Convert.ToDecimal(txtPoELife.Text) + Convert.ToDecimal(txtPoFLife.Text) +
                   Convert.ToDecimal(txtPoILife.Text) + Convert.ToDecimal(txtPoLLife.Text) + Convert.ToDecimal(txtVitLife.Text) +
                   Convert.ToDecimal(txtTSLife.Text);      
            txtAuraTotalMana.Text = mana.ToString();
            txtAuraTotalLife.Text = life.ToString();
            txtAuraRemainingMana.Text = (Convert.ToDecimal(txtManaFinal.Text)- mana).ToString();
            txtAuraRemainingLife.Text = (Convert.ToDecimal(txtLifeFinal.Text) - life).ToString();
            
        }
        private void updateAuraAnger()
        {
//            MessageBox.Show("Inside updateAuraAnger!");
            cboAngLvl.SelectedIndex = cboAngLvl.FindString(Convert.ToString(myChar.Anger[0]));
            if (myChar.Anger[0] > 0)
            {
               /* MessageBox.Show("Anger 0:" + myChar.Anger[0] + "\n" +
                                "      1:" + myChar.Anger[1] + "\n" +
                                "      2:" + myChar.Anger[2] + "\n" +
                                "      3:" + myChar.Anger[3] + "\n" +
                                "      4:" + myChar.Anger[4] + "\n" +
                                "      5:" + myChar.Anger[5] + "\n");*/
                cboAngRM.SelectedIndex = cboAngRM.FindString(Convert.ToString(myChar.Anger[1]));
                cboAngBM.SelectedIndex = cboAngBM.FindString(Convert.ToString(myChar.Anger[2]));
                if (myChar.Anger[2] < 180 && myChar.BM == 0)
                {
                    txtAngMana.Text = myChar.strAuraCost("Anger");
                    txtAngLife.Text = "0";
                }
                else
                {
                    txtAngMana.Text = "0";
                    txtAngLife.Text = myChar.strAuraCost("Anger");
                }  
                // ADD IN CALCS TO SHOW ADJUSTED MANA % ??
                txtAngEff1.Text = myChar.strAuraEffects("Anger")[0];
                txtAngEff2.Text = myChar.strAuraEffects("Anger")[1];
                //MessageBox.Show("Endof > 0");
            }
            else
            {
                cboAngLvl.SelectedIndex = cboAngLvl.FindString("0");
                cboAngRM.SelectedIndex = cboAngRM.FindString("100");
                cboAngBM.SelectedIndex = cboAngBM.FindString("0");
                txtAngMana.Text = "0";
                txtAngLife.Text = "0";
                txtAngEff1.Text = "";
                txtAngEff2.Text = "";
                //MessageBox.Show("Endof <= 0");
            }
            updateAuraCosts();

        }
        private void cboAngLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Anger", Convert.ToDecimal(cboAngLvl.Text));
            updateAuraAnger();
        }
        private void cboAngRM_Leave(object sender, EventArgs e)
        {
            myChar.Anger[1] = Convert.ToDecimal(cboAngRM.Text);
            updateAuraAnger();
        }
        private void cboAngBM_Leave(object sender, EventArgs e)
        {
            myChar.Anger[2] = Convert.ToDecimal(cboAngBM.Text);
            updateAuraAnger();
        }

        private void updateAuraClarity(string opt)
        {
            //            MessageBox.Show("Inside updateAuraClarity!");
            cboClaLvl.SelectedIndex = cboClaLvl.FindString(Convert.ToString(myChar.Clarity[0]));
            if (myChar.Clarity[0] > 0)
            {
                cboClaRM.SelectedIndex = cboClaRM.FindString(Convert.ToString(myChar.Clarity[1]));
                cboClaBM.SelectedIndex = cboClaBM.FindString(Convert.ToString(myChar.Clarity[2]));
                if (myChar.Clarity[2] < 180 && myChar.BM == 0)
                {
                    txtClaMana.Text = myChar.strAuraCost("Clarity");
                    txtClaLife.Text = "0";
                }
                else
                {
                    txtClaMana.Text = "0";
                    txtClaLife.Text = myChar.strAuraCost("Clarity");
                }
                txtClaBase.Text = myChar.Clarity[3].ToString("0");
                txtClaEff1.Text = myChar.strAuraEffects("Clarity")[0];
            }
            else
            {
                cboClaLvl.SelectedIndex = cboClaLvl.FindString("0");
                cboClaRM.SelectedIndex = cboClaRM.FindString("100");
                cboClaBM.SelectedIndex = cboClaBM.FindString("0");
                txtClaBase.Text = "";
                txtClaMana.Text = "0";
                txtClaLife.Text = "0";
                txtClaEff1.Text = "";
            }
            if(opt == "yes") updateManaReg();
            updateAuraCosts();

        }
        private void cboClaLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Clarity", Convert.ToDecimal(cboClaLvl.Text));
            updateAuraClarity("yes");
        }
        private void cboClaRM_Leave(object sender, EventArgs e)
        {
            myChar.Clarity[1] = Convert.ToDecimal(cboClaRM.Text);
            updateAuraClarity("no");
        }
        private void cboClaBM_Leave(object sender, EventArgs e)
        {
            myChar.Clarity[2] = Convert.ToDecimal(cboClaBM.Text);
            updateAuraClarity("no");
        }

        private void updateAuraDetermination(string opt)
        {
            cboDetLvl.SelectedIndex = cboDetLvl.FindString(Convert.ToString(myChar.Determination[0]));
            if (myChar.Determination[0] > 0)
            {
                cboDetRM.SelectedIndex = cboDetRM.FindString(Convert.ToString(myChar.Determination[1]));
                cboDetBM.SelectedIndex = cboDetBM.FindString(Convert.ToString(myChar.Determination[2]));
                if (myChar.Determination[2] < 180 && myChar.BM == 0)
                {
                    txtDetMana.Text = myChar.strAuraCost("Determination");
                    txtDetLife.Text = "0";
                }
                else
                {
                    txtDetMana.Text = "0";
                    txtDetLife.Text = myChar.strAuraCost("Determination");
                }
                txtDetEff1.Text = myChar.strAuraEffects("Determination")[0];
                txtArmorMore.Text = myChar.strArmorMore();
            }
            else
            {
                cboDetLvl.SelectedIndex = cboDetLvl.FindString("0");
                cboDetRM.SelectedIndex = cboDetRM.FindString("100");
                cboDetBM.SelectedIndex = cboDetBM.FindString("0");
                txtDetMana.Text = "0";
                txtDetLife.Text = "0";
                txtDetEff1.Text = "";    
            }
            if (opt == "yes") updateArmor();
            updateAuraCosts();

        }
        private void cboDetLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Determination", Convert.ToDecimal(cboDetLvl.Text));
            updateAuraDetermination("yes");
        }
        private void cboDetRM_Leave(object sender, EventArgs e)
        {
            myChar.Determination[1] = Convert.ToDecimal(cboDetRM.Text);
            updateAuraDetermination("no");
        }
        private void cboDetBM_Leave(object sender, EventArgs e)
        {
            myChar.Determination[2] = Convert.ToDecimal(cboDetBM.Text);
            updateAuraDetermination("no");
        }

        private void updateAuraDiscipline(string opt)
        {
            cboDisLvl.SelectedIndex = cboDisLvl.FindString(Convert.ToString(myChar.Discipline[0]));
            if (myChar.Discipline[0] > 0)
            {
                cboDisRM.SelectedIndex = cboDisRM.FindString(Convert.ToString(myChar.Discipline[1]));
                cboDisBM.SelectedIndex = cboDisBM.FindString(Convert.ToString(myChar.Discipline[2]));
                if (myChar.Discipline[2] < 180 && myChar.BM == 0)
                {
                    txtDisMana.Text = myChar.strAuraCost("Discipline");
                    txtDisLife.Text = "0";
                }
                else
                {
                    txtDisMana.Text = "0";
                    txtDisLife.Text = myChar.strAuraCost("Discipline");
                }
                txtDisEff1.Text = myChar.strAuraEffects("Discipline")[0];
            }
            else
            {
                cboDisLvl.SelectedIndex = cboDisLvl.FindString("0");
                cboDisRM.SelectedIndex = cboDisRM.FindString("100");
                cboDisBM.SelectedIndex = cboDisBM.FindString("0");
                txtDisMana.Text = "0";
                txtDisLife.Text = "0";
                txtDisEff1.Text = "";
            }
            if (opt == "yes") this.updateES();
            updateAuraCosts();
        }
        private void cboDisLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Discipline", Convert.ToDecimal(cboDisLvl.Text));
            updateAuraDiscipline("yes");
        }
        private void cboDisRM_Leave(object sender, EventArgs e)
        {
            myChar.Discipline[1] = Convert.ToDecimal(cboDisRM.Text);
            updateAuraDiscipline("no");
        }
        private void cboDisBM_Leave(object sender, EventArgs e)
        {
            myChar.Discipline[2] = Convert.ToDecimal(cboDisBM.Text);
            updateAuraDiscipline("no");
        }

        private void updateAuraGrace(string opt)
        {
            cboGraLvl.SelectedIndex = cboGraLvl.FindString(Convert.ToString(myChar.Grace[0]));
            if (myChar.Grace[0] > 0)
            {
                cboGraRM.SelectedIndex = cboGraRM.FindString(Convert.ToString(myChar.Grace[1]));
                cboGraBM.SelectedIndex = cboGraBM.FindString(Convert.ToString(myChar.Grace[2]));
                if (myChar.Grace[2] < 180 && myChar.BM == 0)
                {
                    txtGraMana.Text = myChar.strAuraCost("Grace");
                    txtGraLife.Text = "0";
                }
                else
                {
                    txtGraMana.Text = "0";
                    txtGraLife.Text = myChar.strAuraCost("Grace");
                }
                txtGraEff1.Text = myChar.strAuraEffects("Grace")[0];
            }
            else
            {
                cboGraLvl.SelectedIndex = cboGraLvl.FindString("0");
                cboGraRM.SelectedIndex = cboGraRM.FindString("100");
                cboGraBM.SelectedIndex = cboGraBM.FindString("0");
                txtGraMana.Text = "0";
                txtGraLife.Text = "0";
                txtGraEff1.Text = "";
            }
            if (opt == "yes") this.updateEvade();
            updateAuraCosts();

        }
        private void cboGraLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Grace", Convert.ToDecimal(cboGraLvl.Text));
            updateAuraGrace("yes");
        }
        private void cboGraRM_Leave(object sender, EventArgs e)
        {
            myChar.Grace[1] = Convert.ToDecimal(cboGraRM.Text);
            updateAuraGrace("no");
        }
        private void cboGraBM_Leave(object sender, EventArgs e)
        {
            myChar.Grace[2] = Convert.ToDecimal(cboGraBM.Text);
            updateAuraGrace("no");
        }

        private void updateAuraHaste(string opt)
        {
            cboHasLvl.SelectedIndex = cboHasLvl.FindString(Convert.ToString(myChar.Haste[0]));
            if (myChar.Haste[0] > 0)
            {
                cboHasRM.SelectedIndex = cboHasRM.FindString(Convert.ToString(myChar.Haste[1]));
                cboHasBM.SelectedIndex = cboHasBM.FindString(Convert.ToString(myChar.Haste[2]));
                if (myChar.Haste[2] < 180 && myChar.BM == 0)
                {
                    txtHasMana.Text = myChar.strAuraCost("Haste");
                    txtHasLife.Text = "0";
                }
                else
                {
                    txtHasMana.Text = "0";
                    txtHasLife.Text = myChar.strAuraCost("Haste");
                }
                txtHasEff1.Text = myChar.strAuraEffects("Haste")[0];
                txtHasEff2.Text = myChar.strAuraEffects("Haste")[1];
                txtHasEff3.Text = myChar.strAuraEffects("Haste")[2];
            }
            else
            {
                cboHasLvl.SelectedIndex = cboHasLvl.FindString("0");
                cboHasRM.SelectedIndex = cboHasRM.FindString("100");
                cboHasBM.SelectedIndex = cboHasBM.FindString("0");
                txtHasMana.Text = "0";
                txtHasLife.Text = "0";
                txtHasEff1.Text = "";
                txtHasEff2.Text = "";
                txtHasEff3.Text = "";
            }
            updateAuraCosts();
        }
        private void cboHasLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Haste", Convert.ToDecimal(cboHasLvl.Text));
            updateAuraHaste("yes");
        }
        private void cboHasRM_Leave(object sender, EventArgs e)
        {
            myChar.Haste[1] = Convert.ToDecimal(cboHasRM.Text);
            updateAuraHaste("no");
        }
        private void cboHasBM_Leave(object sender, EventArgs e)
        {
            myChar.Haste[2] = Convert.ToDecimal(cboHasBM.Text);
            updateAuraHaste("no");
        }
        private void updateAuraHatred(string opt)
        {
            cboHatLvl.SelectedIndex = cboHatLvl.FindString(Convert.ToString(myChar.Hatred[0]));
            if (myChar.Hatred[0] > 0)
            {
                cboHatRM.SelectedIndex = cboHatRM.FindString(Convert.ToString(myChar.Hatred[1]));
                cboHatBM.SelectedIndex = cboHatBM.FindString(Convert.ToString(myChar.Hatred[2]));
                if (myChar.Hatred[2] < 180 && myChar.BM == 0)
                {
                    txtHatMana.Text = myChar.strAuraCost("Hatred");
                    txtHatLife.Text = "0";
                }
                else
                {
                    txtHatMana.Text = "0";
                    txtHatLife.Text = myChar.strAuraCost("Hatred");
                }
                txtHatEff1.Text = myChar.strAuraEffects("Hatred")[0];
            }
            else
            {
                cboHatLvl.SelectedIndex = cboHatLvl.FindString("0");
                cboHatRM.SelectedIndex = cboHatRM.FindString("100");
                cboHatBM.SelectedIndex = cboHatBM.FindString("0");
                txtHatMana.Text = "0";
                txtHatLife.Text = "0";
                txtHatEff1.Text = "";
            }
            updateAuraCosts();

        }
        private void cboHatLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Hatred", Convert.ToDecimal(cboHatLvl.Text));
            updateAuraHatred("yes");
        }
        private void cboHatRM_Leave(object sender, EventArgs e)
        {
            myChar.Hatred[1] = Convert.ToDecimal(cboHatRM.Text);
            updateAuraHatred("no");
        }
        private void cboHatBM_Leave(object sender, EventArgs e)
        {
            myChar.Hatred[2] = Convert.ToDecimal(cboHatBM.Text);
            updateAuraHatred("no");
        }
        private void updateAuraPurity(string opt)
        {
            cboPoELvl.SelectedIndex = cboPoELvl.FindString(Convert.ToString(myChar.Purity[0]));
            if (myChar.Purity[0] > 0)
            {
                cboPoERM.SelectedIndex = cboPoERM.FindString(Convert.ToString(myChar.Purity[1]));
                cboPoEBM.SelectedIndex = cboPoEBM.FindString(Convert.ToString(myChar.Purity[2]));
                if (myChar.Purity[2] < 180 && myChar.BM == 0)
                {
                    txtPoEMana.Text = myChar.strAuraCost("Purity");
                    txtPoELife.Text = "0";
                }
                else
                {
                    txtPoEMana.Text = "0";
                    txtPoELife.Text = myChar.strAuraCost("Purity");
                }
                txtPoEEff1.Text = myChar.strAuraEffects("Purity")[0];
            }
            else
            {
                cboPoELvl.SelectedIndex = cboPoELvl.FindString("0");
                cboPoERM.SelectedIndex = cboPoERM.FindString("100");
                cboPoEBM.SelectedIndex = cboPoEBM.FindString("0");
                txtPoEMana.Text = "0";
                txtPoELife.Text = "0";
                txtPoEEff1.Text = "";
            }
            if (opt == "yes") this.updateResists();
            updateAuraCosts();

        }
        private void cboPoELvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Purity", Convert.ToDecimal(cboPoELvl.Text));
            updateAuraPurity("yes");
        }
        private void cboPoERM_Leave(object sender, EventArgs e)
        {
            myChar.Purity[1] = Convert.ToDecimal(cboPoERM.Text);
            updateAuraPurity("no");
        }
        private void cboPoEBM_Leave(object sender, EventArgs e)
        {
            myChar.Purity[2] = Convert.ToDecimal(cboPoEBM.Text);
            updateAuraPurity("no");
        }
        private void updateAuraPurityofFire(string opt)
        {
            cboPoFLvl.SelectedIndex = cboPoFLvl.FindString(Convert.ToString(myChar.PurFire[0]));
            if (myChar.PurFire[0] > 0)
            {
                cboPoFRM.SelectedIndex = cboPoFRM.FindString(Convert.ToString(myChar.PurFire[1]));
                cboPoFBM.SelectedIndex = cboPoFBM.FindString(Convert.ToString(myChar.PurFire[2]));
                if (myChar.PurFire[2] < 180 && myChar.BM == 0)
                {
                    txtPoFMana.Text = myChar.strAuraCost("PurityofFire");
                    txtPoFLife.Text = "0";
                }
                else
                {
                    txtPoFMana.Text = "0";
                    txtPoFLife.Text = myChar.strAuraCost("PurityofFire");
                }
                txtPoFEff1.Text = myChar.strAuraEffects("PurityofFire")[0];
                txtPoFEff2.Text = myChar.strAuraEffects("PurityofFire")[1];
            }
            else
            {
                cboPoFLvl.SelectedIndex = cboPoFLvl.FindString("0");
                cboPoFRM.SelectedIndex = cboPoFRM.FindString("100");
                cboPoFBM.SelectedIndex = cboPoFBM.FindString("0");
                txtPoFMana.Text = "0";
                txtPoFLife.Text = "0";
                txtPoFEff1.Text = "";
                txtPoFEff2.Text = "";
            }
            if (opt == "yes") this.updateResists();
            updateAuraCosts();
        }
        private void cboPoFLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("PurityofFire", Convert.ToDecimal(cboPoFLvl.Text));
            updateAuraPurityofFire("yes");
        }
        private void cboPoFRM_Leave(object sender, EventArgs e)
        {
            myChar.PurFire[1] = Convert.ToDecimal(cboPoFRM.Text);
            updateAuraPurityofFire("no");
        }
        private void cboPoFBM_Leave(object sender, EventArgs e)
        {
            myChar.PurFire[2] = Convert.ToDecimal(cboPoFBM.Text);
            updateAuraPurityofFire("no");
        }
        private void updateAuraPurityofIce(string opt)
        {
            cboPoILvl.SelectedIndex = cboPoILvl.FindString(Convert.ToString(myChar.PurCold[0]));
            if (myChar.PurCold[0] > 0)
            {
                cboPoIRM.SelectedIndex = cboPoIRM.FindString(Convert.ToString(myChar.PurCold[1]));
                cboPoIBM.SelectedIndex = cboPoIBM.FindString(Convert.ToString(myChar.PurCold[2]));
                if (myChar.PurCold[2] < 180 && myChar.BM == 0)
                {
                    txtPoIMana.Text = myChar.strAuraCost("PurityofIce");
                    txtPoILife.Text = "0";
                }
                else
                {
                    txtPoIMana.Text = "0";
                    txtPoILife.Text = myChar.strAuraCost("PurityofIce");
                }
                txtPoIEff1.Text = myChar.strAuraEffects("PurityofIce")[0];
                txtPoIEff2.Text = myChar.strAuraEffects("PurityofIce")[1];
            }
            else
            {
                cboPoILvl.SelectedIndex = cboPoILvl.FindString("0");
                cboPoIRM.SelectedIndex = cboPoIRM.FindString("100");
                cboPoIBM.SelectedIndex = cboPoIBM.FindString("0");
                txtPoIMana.Text = "0";
                txtPoILife.Text = "0";
                txtPoIEff1.Text = "";
                txtPoIEff2.Text = "";
            }
            if (opt == "yes") this.updateResists();
            updateAuraCosts();
        }
        private void cboPoILvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("PurityofIce", Convert.ToDecimal(cboPoILvl.Text));
            updateAuraPurityofIce("yes");
        }
        private void cboPoIRM_Leave(object sender, EventArgs e)
        {
            myChar.PurCold[1] = Convert.ToDecimal(cboPoIRM.Text);
            updateAuraPurityofIce("no");
        }
        private void cboPoIBM_Leave(object sender, EventArgs e)
        {
            myChar.PurCold[2] = Convert.ToDecimal(cboPoIBM.Text);
            updateAuraPurityofIce("no");
        }
        private void updateAuraPurityofLightning(string opt)
        {
            cboPoLLvl.SelectedIndex = cboPoLLvl.FindString(Convert.ToString(myChar.PurLight[0]));
            if (myChar.PurLight[0] > 0)
            {
                cboPoLRM.SelectedIndex = cboPoLRM.FindString(Convert.ToString(myChar.PurLight[1]));
                cboPoLBM.SelectedIndex = cboPoLBM.FindString(Convert.ToString(myChar.PurLight[2]));
                if (myChar.PurLight[2] < 180 && myChar.BM == 0)
                {
                    txtPoLMana.Text = myChar.strAuraCost("PurityofLightning");
                    txtPoLLife.Text = "0";
                }
                else
                {
                    txtPoLMana.Text = "0";
                    txtPoLLife.Text = myChar.strAuraCost("PurityofLightning");
                }
                txtPoLEff1.Text = myChar.strAuraEffects("PurityofLightning")[0];
                txtPoLEff2.Text = myChar.strAuraEffects("PurityofLightning")[1];
            }
            else
            {
                cboPoLLvl.SelectedIndex = cboPoLLvl.FindString("0");
                cboPoLRM.SelectedIndex = cboPoLRM.FindString("100");
                cboPoLBM.SelectedIndex = cboPoLBM.FindString("0");
                txtPoLMana.Text = "0";
                txtPoLLife.Text = "0";
                txtPoLEff1.Text = "";
                txtPoLEff2.Text = "";
            }
            if (opt == "yes") this.updateResists();
            updateAuraCosts();

        }
        private void cboPoLLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("PurityofLightning", Convert.ToDecimal(cboPoLLvl.Text));
            updateAuraPurityofLightning("yes");
        }
        private void cboPoLRM_Leave(object sender, EventArgs e)
        {
            myChar.PurLight[1] = Convert.ToDecimal(cboPoLRM.Text);
            updateAuraPurityofLightning("no");
        }
        private void cboPoLBM_Leave(object sender, EventArgs e)
        {
            myChar.PurLight[2] = Convert.ToDecimal(cboPoLBM.Text);
            updateAuraPurityofLightning("no");
        }
        private void updateAuraVitality(string opt)
        {
            cboVitLvl.SelectedIndex = cboVitLvl.FindString(Convert.ToString(myChar.Vitality[0]));
            if (myChar.Vitality[0] > 0)
            {
                cboVitRM.SelectedIndex = cboVitRM.FindString(Convert.ToString(myChar.Vitality[1]));
                cboVitBM.SelectedIndex = cboVitBM.FindString(Convert.ToString(myChar.Vitality[2]));
                if (myChar.Vitality[2] < 180 && myChar.BM == 0)
                {
                    txtVitMana.Text = myChar.strAuraCost("Vitality");
                    txtVitLife.Text = "0";
                }
                else
                {
                    txtVitMana.Text = "0";
                    txtVitLife.Text = myChar.strAuraCost("Vitality");
                }
                txtVitEff1.Text = myChar.strAuraEffects("Vitality")[0];
            }
            else
            {
                cboVitLvl.SelectedIndex = cboVitLvl.FindString("0");
                cboVitRM.SelectedIndex = cboVitRM.FindString("100");
                cboVitBM.SelectedIndex = cboVitBM.FindString("0");
                txtVitMana.Text = "0";
                txtVitLife.Text = "0";
                txtVitEff1.Text = "";
            }
            if (opt == "yes") this.updateReg();
            updateAuraCosts();

        }
        private void cboVitLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("Vitality", Convert.ToDecimal(cboVitLvl.Text));
            updateAuraVitality("yes");
        }
        private void cboVitRM_Leave(object sender, EventArgs e)
        {
            myChar.Vitality[1] = Convert.ToDecimal(cboVitRM.Text);
            updateAuraVitality("no");
        }
        private void cboVitBM_Leave(object sender, EventArgs e)
        {
            myChar.Vitality[2] = Convert.ToDecimal(cboVitBM.Text);
            updateAuraVitality("no");
        }
        private void updateAuraTempestShield(string opt)
        {
            cboTSLvl.SelectedIndex = cboTSLvl.FindString(Convert.ToString(myChar.TempShld[0]));
            if (myChar.TempShld[0] > 0)
            {
                cboTSRM.SelectedIndex = cboTSRM.FindString(Convert.ToString(myChar.TempShld[1]));
                cboTSBM.SelectedIndex = cboTSBM.FindString(Convert.ToString(myChar.TempShld[2]));
                if (myChar.TempShld[2] < 180 && myChar.BM == 0)
                {
                    txtTSMana.Text = myChar.strAuraCost("TempestShield");
                    txtTSLife.Text = "0";
                }
                else
                {
                    txtTSMana.Text = "0";
                    txtTSLife.Text = myChar.strAuraCost("TempestShield");
                }
                txtTSEff1.Text = myChar.strAuraEffects("TempestShield")[0];
                txtTSEff2.Text = myChar.strAuraEffects("TempestShield")[1];
                txtTSEff3.Text = myChar.strAuraEffects("TempestShield")[2];
            }
            else
            {
                cboTSLvl.SelectedIndex = cboTSLvl.FindString("0");
                cboTSRM.SelectedIndex = cboTSRM.FindString("100");
                cboTSBM.SelectedIndex = cboTSBM.FindString("0");
                txtTSMana.Text = "0";
                txtTSLife.Text = "0";
                txtTSEff1.Text = "";
                txtTSEff2.Text = "";
                txtTSEff3.Text = "";
            }
            if (opt == "yes") updateShield();
            updateAuraCosts();

        }
        private void cboTSLvl_Leave(object sender, EventArgs e)
        {
            myChar.setAura("TempestShield", Convert.ToDecimal(cboTSLvl.Text));
            updateAuraTempestShield("yes");
        }
        private void cboTSRM_Leave(object sender, EventArgs e)
        {
            myChar.TempShld[1] = Convert.ToDecimal(cboTSRM.Text);
            updateAuraTempestShield("no");
        }
        private void cboTSBM_Leave(object sender, EventArgs e)
        {
            myChar.TempShld[2] = Convert.ToDecimal(cboTSBM.Text);
            updateAuraTempestShield("no");
        }

        //

        //============================================================================================
        //                                         DPS TAB 
        //============================================================================================

        private void txtDPSBaseAPS_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.baseAPS);
            this.updateDPS();
        }
        private void txtDPSBaseCast_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.baseCastTime);
            this.updateDPS();
        }
        
        private void txtDPSBaseCritAtk_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.baseCritAtk);
            this.updateDPS();
        }
        private void txtDPSBaseCritSpell_Leave(object sender, EventArgs e)
        {
            decCheckBox((TextBox)sender, out myChar.baseCritSpell);
            this.updateDPS();
        }
            

        //-----------------------------------------LOAD FROM FILE------------------------------------//


        private void fillFormFromFile()
        {
            txtName.Text = myChar.charName;
//            cboClass.SelectedText = myChar.charClass;
            cboClass.SelectedIndex = cboClass.FindString(myChar.charClass);
            txtLvl.Text = Convert.ToString(myChar.level);
          

            if (myChar.CI == 1) chkCI.Checked = true;
            if (myChar.IR == 1) chkIR.Checked = true;
            if (myChar.EB == 1) chkEB.Checked = true;
            if (myChar.AC == 1) chkAC.Checked = true;
            if (myChar.ZO == 1) chkZO.Checked = true;
            if (myChar.BM == 1) chkBM.Checked = true;
            if (myChar.NA == 1) chkNA.Checked = true;
            if (myChar.Cruel == 1) chkCruel.Checked = true;
            if (myChar.Merc == 1) chkMerc.Checked = true;
            if (myChar.DW == 1) chkDW.Checked = true;
            if (myChar.Ranged == 1) chkRanged.Checked = true;

            txtStrBase.Text = myChar.strBaseStr();
            txtDexBase.Text = myChar.strBaseDex();
            txtIntBase.Text = myChar.strBaseInt();

            gnHeadLife.Text = Convert.ToString(myChar.LifeAdd[0]);
            gnChestLife.Text = Convert.ToString(myChar.LifeAdd[1]);
            gnMainHLife.Text = Convert.ToString(myChar.LifeAdd[2]);
            gnOffHLife.Text = Convert.ToString(myChar.LifeAdd[3]);
            gnGlovesLife.Text = Convert.ToString(myChar.LifeAdd[4]);
            gnBootsLife.Text = Convert.ToString(myChar.LifeAdd[5]);
            gnBeltLife.Text = Convert.ToString(myChar.LifeAdd[6]);
            gnRing1Life.Text = Convert.ToString(myChar.LifeAdd[7]);
            gnRing2Life.Text = Convert.ToString(myChar.LifeAdd[8]);
            gnAmuLife.Text = Convert.ToString(myChar.LifeAdd[9]);
            gnNodeLife.Text = Convert.ToString(myChar.LifeAdd[10]);

            gnHeadLifeAddP.Text = Convert.ToString(myChar.LifeAddP[0]);
            gnChestLifeAddP.Text = Convert.ToString(myChar.LifeAddP[1]);
            gnMainHLifeAddP.Text = Convert.ToString(myChar.LifeAddP[2]);
            gnOffHLifeAddP.Text = Convert.ToString(myChar.LifeAddP[3]);
            gnGlovesLifeAddP.Text = Convert.ToString(myChar.LifeAddP[4]);
            gnBootsLifeAddP.Text = Convert.ToString(myChar.LifeAddP[5]);
            gnBeltLifeAddP.Text = Convert.ToString(myChar.LifeAddP[6]);
            gnRing1LifeAddP.Text = Convert.ToString(myChar.LifeAddP[7]);
            gnRing2LifeAddP.Text = Convert.ToString(myChar.LifeAddP[8]);
            gnAmuLifeAddP.Text = Convert.ToString(myChar.LifeAddP[9]);
            gnNodeLifeAddP.Text = Convert.ToString(myChar.LifeAddP[10]);

            gnHeadReg.Text = Convert.ToString(myChar.RegAdd[0]);
            gnChestReg.Text = Convert.ToString(myChar.RegAdd[1]);
            gnMainHReg.Text = Convert.ToString(myChar.RegAdd[2]);
            gnOffHReg.Text = Convert.ToString(myChar.RegAdd[3]);
            gnGlovesReg.Text = Convert.ToString(myChar.RegAdd[4]);
            gnBootsReg.Text = Convert.ToString(myChar.RegAdd[5]);
            gnBeltReg.Text = Convert.ToString(myChar.RegAdd[6]);
            gnRing1Reg.Text = Convert.ToString(myChar.RegAdd[7]);
            gnRing2Reg.Text = Convert.ToString(myChar.RegAdd[8]);
            gnAmuReg.Text = Convert.ToString(myChar.RegAdd[9]);
            gnNodeReg.Text = Convert.ToString(myChar.RegAdd[10]);

            gnHeadRegAddP.Text = Convert.ToString(myChar.RegAddP[0]);
            gnChestRegAddP.Text = Convert.ToString(myChar.RegAddP[1]);
            gnMainHRegAddP.Text = Convert.ToString(myChar.RegAddP[2]);
            gnOffHRegAddP.Text = Convert.ToString(myChar.RegAddP[3]);
            gnGlovesRegAddP.Text = Convert.ToString(myChar.RegAddP[4]);
            gnBootsRegAddP.Text = Convert.ToString(myChar.RegAddP[5]);
            gnBeltRegAddP.Text = Convert.ToString(myChar.RegAddP[6]);
            gnRing1RegAddP.Text = Convert.ToString(myChar.RegAddP[7]);
            gnRing2RegAddP.Text = Convert.ToString(myChar.RegAddP[8]);
            gnAmuRegAddP.Text = Convert.ToString(myChar.RegAddP[9]);
            gnNodeRegAddP.Text = Convert.ToString(myChar.RegAddP[10]);

            //MANA
            gnHeadMana.Text = Convert.ToString(myChar.ManaAdd[0]);
            gnChestMana.Text = Convert.ToString(myChar.ManaAdd[1]);
            gnMainHMana.Text = Convert.ToString(myChar.ManaAdd[2]);
            gnOffHMana.Text = Convert.ToString(myChar.ManaAdd[3]);
            gnGlovesMana.Text = Convert.ToString(myChar.ManaAdd[4]);
            gnBootsMana.Text = Convert.ToString(myChar.ManaAdd[5]);
            gnBeltMana.Text = Convert.ToString(myChar.ManaAdd[6]);
            gnRing1Mana.Text = Convert.ToString(myChar.ManaAdd[7]);
            gnRing2Mana.Text = Convert.ToString(myChar.ManaAdd[8]);
            gnAmuMana.Text = Convert.ToString(myChar.ManaAdd[9]);
            gnNodeMana.Text = Convert.ToString(myChar.ManaAdd[10]);

            gnHeadManaAddP.Text = Convert.ToString(myChar.ManaAddP[0]);
            gnChestManaAddP.Text = Convert.ToString(myChar.ManaAddP[1]);
            gnMainHManaAddP.Text = Convert.ToString(myChar.ManaAddP[2]);
            gnOffHManaAddP.Text = Convert.ToString(myChar.ManaAddP[3]);
            gnGlovesManaAddP.Text = Convert.ToString(myChar.ManaAddP[4]);
            gnBootsManaAddP.Text = Convert.ToString(myChar.ManaAddP[5]);
            gnBeltManaAddP.Text = Convert.ToString(myChar.ManaAddP[6]);
            gnRing1ManaAddP.Text = Convert.ToString(myChar.ManaAddP[7]);
            gnRing2ManaAddP.Text = Convert.ToString(myChar.ManaAddP[8]);
            gnAmuManaAddP.Text = Convert.ToString(myChar.ManaAddP[9]);
            gnNodeManaAddP.Text = Convert.ToString(myChar.ManaAddP[10]);

            gnHeadManaReg.Text = Convert.ToString(myChar.ManaRegAdd[0]);
            gnChestManaReg.Text = Convert.ToString(myChar.ManaRegAdd[1]);
            gnMainHManaReg.Text = Convert.ToString(myChar.ManaRegAdd[2]);
            gnOffHManaReg.Text = Convert.ToString(myChar.ManaRegAdd[3]);
            gnGlovesManaReg.Text = Convert.ToString(myChar.ManaRegAdd[4]);
            gnBootsManaReg.Text = Convert.ToString(myChar.ManaRegAdd[5]);
            gnBeltManaReg.Text = Convert.ToString(myChar.ManaRegAdd[6]);
            gnRing1ManaReg.Text = Convert.ToString(myChar.ManaRegAdd[7]);
            gnRing2ManaReg.Text = Convert.ToString(myChar.ManaRegAdd[8]);
            gnAmuManaReg.Text = Convert.ToString(myChar.ManaRegAdd[9]);
            gnNodeManaReg.Text = Convert.ToString(myChar.ManaRegAdd[10]);

            gnHeadManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[0]);
            gnChestManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[1]);
            gnMainHManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[2]);
            gnOffHManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[3]);
            gnGlovesManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[4]);
            gnBootsManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[5]);
            gnBeltManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[6]);
            gnRing1ManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[7]);
            gnRing2ManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[8]);
            gnAmuManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[9]);
            gnNodeManaRegAddP.Text = Convert.ToString(myChar.ManaRegAddP[10]);

            // STATS
            gnHeadStr.Text = Convert.ToString(myChar.StrAdd[0]);
            gnChestStr.Text = Convert.ToString(myChar.StrAdd[1]);
            gnMainHStr.Text = Convert.ToString(myChar.StrAdd[2]);
            gnOffHStr.Text = Convert.ToString(myChar.StrAdd[3]);
            gnGlovesStr.Text = Convert.ToString(myChar.StrAdd[4]);
            gnBootsStr.Text = Convert.ToString(myChar.StrAdd[5]);
            gnBeltStr.Text = Convert.ToString(myChar.StrAdd[6]);
            gnRing1Str.Text = Convert.ToString(myChar.StrAdd[7]);
            gnRing2Str.Text = Convert.ToString(myChar.StrAdd[8]);
            gnAmuStr.Text = Convert.ToString(myChar.StrAdd[9]);
            gnNodeStr.Text = Convert.ToString(myChar.StrAdd[10]);

            gnHeadStrP.Text = Convert.ToString(myChar.StrAddP[0]);
            gnChestStrP.Text = Convert.ToString(myChar.StrAddP[1]);
            gnMainHStrP.Text = Convert.ToString(myChar.StrAddP[2]);
            gnOffHStrP.Text = Convert.ToString(myChar.StrAddP[3]);
            gnGlovesStrP.Text = Convert.ToString(myChar.StrAddP[4]);
            gnBootsStrP.Text = Convert.ToString(myChar.StrAddP[5]);
            gnBeltStrP.Text = Convert.ToString(myChar.StrAddP[6]);
            gnRing1StrP.Text = Convert.ToString(myChar.StrAddP[7]);
            gnRing2StrP.Text = Convert.ToString(myChar.StrAddP[8]);
            gnAmuStrP.Text = Convert.ToString(myChar.StrAddP[9]);
            gnNodeStrP.Text = Convert.ToString(myChar.StrAddP[10]);

            gnHeadDex.Text = Convert.ToString(myChar.DexAdd[0]);
            gnChestDex.Text = Convert.ToString(myChar.DexAdd[1]);
            gnMainHDex.Text = Convert.ToString(myChar.DexAdd[2]);
            gnOffHDex.Text = Convert.ToString(myChar.DexAdd[3]);
            gnGlovesDex.Text = Convert.ToString(myChar.DexAdd[4]);
            gnBootsDex.Text = Convert.ToString(myChar.DexAdd[5]);
            gnBeltDex.Text = Convert.ToString(myChar.DexAdd[6]);
            gnRing1Dex.Text = Convert.ToString(myChar.DexAdd[7]);
            gnRing2Dex.Text = Convert.ToString(myChar.DexAdd[8]);
            gnAmuDex.Text = Convert.ToString(myChar.DexAdd[9]);
            gnNodeDex.Text = Convert.ToString(myChar.DexAdd[10]);

            gnHeadDexP.Text = Convert.ToString(myChar.DexAddP[0]);
            gnChestDexP.Text = Convert.ToString(myChar.DexAddP[1]);
            gnMainHDexP.Text = Convert.ToString(myChar.DexAddP[2]);
            gnOffHDexP.Text = Convert.ToString(myChar.DexAddP[3]);
            gnGlovesDexP.Text = Convert.ToString(myChar.DexAddP[4]);
            gnBootsDexP.Text = Convert.ToString(myChar.DexAddP[5]);
            gnBeltDexP.Text = Convert.ToString(myChar.DexAddP[6]);
            gnRing1DexP.Text = Convert.ToString(myChar.DexAddP[7]);
            gnRing2DexP.Text = Convert.ToString(myChar.DexAddP[8]);
            gnAmuDexP.Text = Convert.ToString(myChar.DexAddP[9]);
            gnNodeDexP.Text = Convert.ToString(myChar.DexAddP[10]);

            gnHeadInt.Text = Convert.ToString(myChar.IntAdd[0]);
            gnChestInt.Text = Convert.ToString(myChar.IntAdd[1]);
            gnMainHInt.Text = Convert.ToString(myChar.IntAdd[2]);
            gnOffHInt.Text = Convert.ToString(myChar.IntAdd[3]);
            gnGlovesInt.Text = Convert.ToString(myChar.IntAdd[4]);
            gnBootsInt.Text = Convert.ToString(myChar.IntAdd[5]);
            gnBeltInt.Text = Convert.ToString(myChar.IntAdd[6]);
            gnRing1Int.Text = Convert.ToString(myChar.IntAdd[7]);
            gnRing2Int.Text = Convert.ToString(myChar.IntAdd[8]);
            gnAmuInt.Text = Convert.ToString(myChar.IntAdd[9]);
            gnNodeInt.Text = Convert.ToString(myChar.IntAdd[10]);

            gnHeadIntP.Text = Convert.ToString(myChar.IntAddP[0]);
            gnChestIntP.Text = Convert.ToString(myChar.IntAddP[1]);
            gnMainHIntP.Text = Convert.ToString(myChar.IntAddP[2]);
            gnOffHIntP.Text = Convert.ToString(myChar.IntAddP[3]);
            gnGlovesIntP.Text = Convert.ToString(myChar.IntAddP[4]);
            gnBootsIntP.Text = Convert.ToString(myChar.IntAddP[5]);
            gnBeltIntP.Text = Convert.ToString(myChar.IntAddP[6]);
            gnRing1IntP.Text = Convert.ToString(myChar.IntAddP[7]);
            gnRing2IntP.Text = Convert.ToString(myChar.IntAddP[8]);
            gnAmuIntP.Text = Convert.ToString(myChar.IntAddP[9]);
            gnNodeIntP.Text = Convert.ToString(myChar.IntAddP[10]);
        
            //MOVE
            gnHeadMove.Text = Convert.ToString(myChar.moveAdd[0]);
            gnChestMove.Text = Convert.ToString(myChar.moveAdd[1]);
            gnMainHMove.Text = Convert.ToString(myChar.moveAdd[2]);
            gnOffHMove.Text = Convert.ToString(myChar.moveAdd[3]);
            gnGlovesMove.Text = Convert.ToString(myChar.moveAdd[4]);
            gnBootsMove.Text = Convert.ToString(myChar.moveAdd[5]);
            gnBeltMove.Text = Convert.ToString(myChar.moveAdd[6]);
            gnRing1Move.Text = Convert.ToString(myChar.moveAdd[7]);
            gnRing2Move.Text = Convert.ToString(myChar.moveAdd[8]);
            gnAmuMove.Text = Convert.ToString(myChar.moveAdd[9]);
            gnNodeMove.Text = Convert.ToString(myChar.moveAdd[10]);

            //CAST SPEED
            gnHeadCastSpeed.Text = Convert.ToString(myChar.castSpeed[0]);
            gnChestCastSpeed.Text = Convert.ToString(myChar.castSpeed[1]);
            gnMainHCastSpeed.Text = Convert.ToString(myChar.castSpeed[2]);
            gnOffHCastSpeed.Text = Convert.ToString(myChar.castSpeed[3]);
            gnGlovesCastSpeed.Text = Convert.ToString(myChar.castSpeed[4]);
            gnBootsCastSpeed.Text = Convert.ToString(myChar.castSpeed[5]);
            gnBeltCastSpeed.Text = Convert.ToString(myChar.castSpeed[6]);
            gnRing1CastSpeed.Text = Convert.ToString(myChar.castSpeed[7]);
            gnRing2CastSpeed.Text = Convert.ToString(myChar.castSpeed[8]);
            gnAmuCastSpeed.Text = Convert.ToString(myChar.castSpeed[9]);
            gnNodeCastSpeed.Text = Convert.ToString(myChar.castSpeed[10]);

            //ATTACK SPEED
            gnHeadAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[0]);
            gnChestAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[1]);
            gnMainHAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[2]);
            gnOffHAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[3]);
            gnGlovesAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[4]);
            gnBootsAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[5]);
            gnBeltAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[6]);
            gnRing1AttackSpeed.Text = Convert.ToString(myChar.attackSpeed[7]);
            gnRing2AttackSpeed.Text = Convert.ToString(myChar.attackSpeed[8]);
            gnAmuAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[9]);
            gnNodeAttackSpeed.Text = Convert.ToString(myChar.attackSpeed[10]);

            //ACCURACY +
            gnHeadAccAdd.Text = Convert.ToString(myChar.accAdd[0]);
            gnChestAccAdd.Text = Convert.ToString(myChar.accAdd[1]);
            gnMainHAccAdd.Text = Convert.ToString(myChar.accAdd[2]);
            gnOffHAccAdd.Text = Convert.ToString(myChar.accAdd[3]);
            gnGlovesAccAdd.Text = Convert.ToString(myChar.accAdd[4]);
            gnBootsAccAdd.Text = Convert.ToString(myChar.accAdd[5]);
            gnBeltAccAdd.Text = Convert.ToString(myChar.accAdd[6]);
            gnRing1AccAdd.Text = Convert.ToString(myChar.accAdd[7]);
            gnRing2AccAdd.Text = Convert.ToString(myChar.accAdd[8]);
            gnAmuAccAdd.Text = Convert.ToString(myChar.accAdd[9]);
            gnNodeAccAdd.Text = Convert.ToString(myChar.accAdd[10]);

            //ACCURACY %
            gnHeadAccAddP.Text = Convert.ToString(myChar.accAddP[0]);
            gnChestAccAddP.Text = Convert.ToString(myChar.accAddP[1]);
            gnMainHAccAddP.Text = Convert.ToString(myChar.accAddP[2]);
            gnOffHAccAddP.Text = Convert.ToString(myChar.accAddP[3]);
            gnGlovesAccAddP.Text = Convert.ToString(myChar.accAddP[4]);
            gnBootsAccAddP.Text = Convert.ToString(myChar.accAddP[5]);
            gnBeltAccAddP.Text = Convert.ToString(myChar.accAddP[6]);
            gnRing1AccAddP.Text = Convert.ToString(myChar.accAddP[7]);
            gnRing2AccAddP.Text = Convert.ToString(myChar.accAddP[8]);
            gnAmuAccAddP.Text = Convert.ToString(myChar.accAddP[9]);
            gnNodeAccAddP.Text = Convert.ToString(myChar.accAddP[10]);

            //ARMOR
            gnHeadArm.Text = Convert.ToString(myChar.ArmorAdd[0]);
            gnChestArm.Text = Convert.ToString(myChar.ArmorAdd[1]);
            gnMainHArm.Text = Convert.ToString(myChar.ArmorAdd[2]);
            gnOffHArm.Text = Convert.ToString(myChar.ArmorAdd[3]);
            gnGlovesArm.Text = Convert.ToString(myChar.ArmorAdd[4]);
            gnBootsArm.Text = Convert.ToString(myChar.ArmorAdd[5]);
            gnBeltArm.Text = Convert.ToString(myChar.ArmorAdd[6]);
            gnRing1Arm.Text = Convert.ToString(myChar.ArmorAdd[7]);
            gnRing2Arm.Text = Convert.ToString(myChar.ArmorAdd[8]);
            gnAmuArm.Text = Convert.ToString(myChar.ArmorAdd[9]);
            gnNodeArm.Text = Convert.ToString(myChar.ArmorAdd[10]);

            gnHeadArmP.Text = Convert.ToString(myChar.ArmorAddP[0]);
            gnChestArmP.Text = Convert.ToString(myChar.ArmorAddP[1]);
            gnMainHArmP.Text = Convert.ToString(myChar.ArmorAddP[2]);
            gnOffHArmP.Text = Convert.ToString(myChar.ArmorAddP[3]);
            gnGlovesArmP.Text = Convert.ToString(myChar.ArmorAddP[4]);
            gnBootsArmP.Text = Convert.ToString(myChar.ArmorAddP[5]);
            gnBeltArmP.Text = Convert.ToString(myChar.ArmorAddP[6]);
            gnRing1ArmP.Text = Convert.ToString(myChar.ArmorAddP[7]);
            gnRing2ArmP.Text = Convert.ToString(myChar.ArmorAddP[8]);
            gnAmuArmP.Text = Convert.ToString(myChar.ArmorAddP[9]);
            gnNodeArmP.Text = Convert.ToString(myChar.ArmorAddP[10]);

            //EVADE
            gnHeadEva.Text = Convert.ToString(myChar.EvadeAdd[0]);
            gnChestEva.Text = Convert.ToString(myChar.EvadeAdd[1]);
            gnMainHEva.Text = Convert.ToString(myChar.EvadeAdd[2]);
            gnOffHEva.Text = Convert.ToString(myChar.EvadeAdd[3]);
            gnGlovesEva.Text = Convert.ToString(myChar.EvadeAdd[4]);
            gnBootsEva.Text = Convert.ToString(myChar.EvadeAdd[5]);
            gnBeltEva.Text = Convert.ToString(myChar.EvadeAdd[6]);
            gnRing1Eva.Text = Convert.ToString(myChar.EvadeAdd[7]);
            gnRing2Eva.Text = Convert.ToString(myChar.EvadeAdd[8]);
            gnAmuEva.Text = Convert.ToString(myChar.EvadeAdd[9]);
            gnNodeEva.Text = Convert.ToString(myChar.EvadeAdd[10]);

            gnHeadEvaP.Text = Convert.ToString(myChar.EvadeAddP[0]);
            gnChestEvaP.Text = Convert.ToString(myChar.EvadeAddP[1]);
            gnMainHEvaP.Text = Convert.ToString(myChar.EvadeAddP[2]);
            gnOffHEvaP.Text = Convert.ToString(myChar.EvadeAddP[3]);
            gnGlovesEvaP.Text = Convert.ToString(myChar.EvadeAddP[4]);
            gnBootsEvaP.Text = Convert.ToString(myChar.EvadeAddP[5]);
            gnBeltEvaP.Text = Convert.ToString(myChar.EvadeAddP[6]);
            gnRing1EvaP.Text = Convert.ToString(myChar.EvadeAddP[7]);
            gnRing2EvaP.Text = Convert.ToString(myChar.EvadeAddP[8]);
            gnAmuEvaP.Text = Convert.ToString(myChar.EvadeAddP[9]);
            gnNodeEvaP.Text = Convert.ToString(myChar.EvadeAddP[10]);

            //ES
            gnHeadES.Text = Convert.ToString(myChar.ESAdd[0]);
            gnChestES.Text = Convert.ToString(myChar.ESAdd[1]);
            gnMainHES.Text = Convert.ToString(myChar.ESAdd[2]);
            gnOffHES.Text = Convert.ToString(myChar.ESAdd[3]);
            gnGlovesES.Text = Convert.ToString(myChar.ESAdd[4]);
            gnBootsES.Text = Convert.ToString(myChar.ESAdd[5]);
            gnBeltES.Text = Convert.ToString(myChar.ESAdd[6]);
            gnRing1ES.Text = Convert.ToString(myChar.ESAdd[7]);
            gnRing2ES.Text = Convert.ToString(myChar.ESAdd[8]);
            gnAmuES.Text = Convert.ToString(myChar.ESAdd[9]);
            gnNodeES.Text = Convert.ToString(myChar.ESAdd[10]);

            gnHeadESP.Text = Convert.ToString(myChar.ESAddP[0]);
            gnChestESP.Text = Convert.ToString(myChar.ESAddP[1]);
            gnMainHESP.Text = Convert.ToString(myChar.ESAddP[2]);
            gnOffHESP.Text = Convert.ToString(myChar.ESAddP[3]);
            gnGlovesESP.Text = Convert.ToString(myChar.ESAddP[4]);
            gnBootsESP.Text = Convert.ToString(myChar.ESAddP[5]);
            gnBeltESP.Text = Convert.ToString(myChar.ESAddP[6]);
            gnRing1ESP.Text = Convert.ToString(myChar.ESAddP[7]);
            gnRing2ESP.Text = Convert.ToString(myChar.ESAddP[8]);
            gnAmuESP.Text = Convert.ToString(myChar.ESAddP[9]);
            gnNodeESP.Text = Convert.ToString(myChar.ESAddP[10]);

            gnNodeArEv.Text = Convert.ToString(myChar.ArmorPlusEvade);

            //BLOCK/DODGE

            gnHeadBlock.Text = Convert.ToString(myChar.blockAdd[0]);            
            gnOffHBlock.Text = Convert.ToString(myChar.blockAdd[3]);
            gnAmuBlock.Text = Convert.ToString(myChar.blockAdd[9]);
            gnNodeBlock.Text = Convert.ToString(myChar.blockAdd[10]);

            gnChestDodge.Text = Convert.ToString(myChar.dodgeAdd[1]);
            gnBootsDodge.Text = Convert.ToString(myChar.dodgeAdd[5]);
            gnNodeDodge.Text = Convert.ToString(myChar.dodgeAdd[10]);

            //FIRE 
            gnHeadResFire.Text = Convert.ToString(myChar.FireAdd[0]);
            gnChestResFire.Text = Convert.ToString(myChar.FireAdd[1]);
            gnMainHResFire.Text = Convert.ToString(myChar.FireAdd[2]);
            gnOffHResFire.Text = Convert.ToString(myChar.FireAdd[3]);
            gnGlovesResFire.Text = Convert.ToString(myChar.FireAdd[4]);
            gnBootsResFire.Text = Convert.ToString(myChar.FireAdd[5]);
            gnBeltResFire.Text = Convert.ToString(myChar.FireAdd[6]);
            gnRing1ResFire.Text = Convert.ToString(myChar.FireAdd[7]);
            gnRing2ResFire.Text = Convert.ToString(myChar.FireAdd[8]);
            gnAmuResFire.Text = Convert.ToString(myChar.FireAdd[9]);
            gnNodeResFire.Text = Convert.ToString(myChar.FireAdd[10]);

            gnHeadResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[0]);
            gnChestResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[1]);
            gnMainHResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[2]);
            gnOffHResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[3]);
            gnGlovesResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[4]);
            gnBootsResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[5]);
            gnBeltResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[6]);
            gnRing1ResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[7]);
            gnRing2ResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[8]);
            gnAmuResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[9]);
            gnNodeResFireMax.Text = Convert.ToString(myChar.FireMaxAdd[10]);

            //COLD
            gnHeadResCold.Text = Convert.ToString(myChar.ColdAdd[0]);
            gnChestResCold.Text = Convert.ToString(myChar.ColdAdd[1]);
            gnMainHResCold.Text = Convert.ToString(myChar.ColdAdd[2]);
            gnOffHResCold.Text = Convert.ToString(myChar.ColdAdd[3]);
            gnGlovesResCold.Text = Convert.ToString(myChar.ColdAdd[4]);
            gnBootsResCold.Text = Convert.ToString(myChar.ColdAdd[5]);
            gnBeltResCold.Text = Convert.ToString(myChar.ColdAdd[6]);
            gnRing1ResCold.Text = Convert.ToString(myChar.ColdAdd[7]);
            gnRing2ResCold.Text = Convert.ToString(myChar.ColdAdd[8]);
            gnAmuResCold.Text = Convert.ToString(myChar.ColdAdd[9]);
            gnNodeResCold.Text = Convert.ToString(myChar.ColdAdd[10]);

            gnHeadResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[0]);
            gnChestResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[1]);
            gnMainHResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[2]);
            gnOffHResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[3]);
            gnGlovesResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[4]);
            gnBootsResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[5]);
            gnBeltResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[6]);
            gnRing1ResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[7]);
            gnRing2ResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[8]);
            gnAmuResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[9]);
            gnNodeResColdMax.Text = Convert.ToString(myChar.ColdMaxAdd[10]);

            //Lightning
            gnHeadResLight.Text = Convert.ToString(myChar.LightAdd[0]);
            gnChestResLight.Text = Convert.ToString(myChar.LightAdd[1]);
            gnMainHResLight.Text = Convert.ToString(myChar.LightAdd[2]);
            gnOffHResLight.Text = Convert.ToString(myChar.LightAdd[3]);
            gnGlovesResLight.Text = Convert.ToString(myChar.LightAdd[4]);
            gnBootsResLight.Text = Convert.ToString(myChar.LightAdd[5]);
            gnBeltResLight.Text = Convert.ToString(myChar.LightAdd[6]);
            gnRing1ResLight.Text = Convert.ToString(myChar.LightAdd[7]);
            gnRing2ResLight.Text = Convert.ToString(myChar.LightAdd[8]);
            gnAmuResLight.Text = Convert.ToString(myChar.LightAdd[9]);
            gnNodeResLight.Text = Convert.ToString(myChar.LightAdd[10]);

            gnHeadResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[0]);
            gnChestResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[1]);
            gnMainHResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[2]);
            gnOffHResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[3]);
            gnGlovesResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[4]);
            gnBootsResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[5]);
            gnBeltResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[6]);
            gnRing1ResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[7]);
            gnRing2ResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[8]);
            gnAmuResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[9]);
            gnNodeResLightMax.Text = Convert.ToString(myChar.LightMaxAdd[10]);

            //CHAOS
            gnHeadResChaos.Text = Convert.ToString(myChar.ChaosAdd[0]);
            gnChestResChaos.Text = Convert.ToString(myChar.ChaosAdd[1]);
            gnMainHResChaos.Text = Convert.ToString(myChar.ChaosAdd[2]);
            gnOffHResChaos.Text = Convert.ToString(myChar.ChaosAdd[3]);
            gnGlovesResChaos.Text = Convert.ToString(myChar.ChaosAdd[4]);
            gnBootsResChaos.Text = Convert.ToString(myChar.ChaosAdd[5]);
            gnBeltResChaos.Text = Convert.ToString(myChar.ChaosAdd[6]);
            gnRing1ResChaos.Text = Convert.ToString(myChar.ChaosAdd[7]);
            gnRing2ResChaos.Text = Convert.ToString(myChar.ChaosAdd[8]);
            gnAmuResChaos.Text = Convert.ToString(myChar.ChaosAdd[9]);
            gnNodeResChaos.Text = Convert.ToString(myChar.ChaosAdd[10]);

            //OFFENSES------
            //increased damage

            gnHeadPhysP.Text = Convert.ToString(myChar.dmgPhysP[0]);
            gnChestPhysP.Text = Convert.ToString(myChar.dmgPhysP[1]);
            gnMainHPhysP.Text = Convert.ToString(myChar.dmgPhysP[2]);
            gnOffHPhysP.Text = Convert.ToString(myChar.dmgPhysP[3]);
            gnGlovesPhysP.Text = Convert.ToString(myChar.dmgPhysP[4]);
            gnBootsPhysP.Text = Convert.ToString(myChar.dmgPhysP[5]);
            gnBeltPhysP.Text = Convert.ToString(myChar.dmgPhysP[6]);
            gnRing1PhysP.Text = Convert.ToString(myChar.dmgPhysP[7]);
            gnRing2PhysP.Text = Convert.ToString(myChar.dmgPhysP[8]);
            gnAmuPhysP.Text = Convert.ToString(myChar.dmgPhysP[9]);
            gnNodePhysP.Text = Convert.ToString(myChar.dmgPhysP[10]);

            gnHeadSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[0]);
            gnChestSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[1]);
            gnMainHSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[2]);
            gnOffHSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[3]);
            gnGlovesSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[4]);
            gnBootsSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[5]);
            gnBeltSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[6]);
            gnRing1SpellDmg.Text = Convert.ToString(myChar.dmgSpellP[7]);
            gnRing2SpellDmg.Text = Convert.ToString(myChar.dmgSpellP[8]);
            gnAmuSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[9]);
            gnNodeSpellDmg.Text = Convert.ToString(myChar.dmgSpellP[10]);

            gnNodeMeleePhysP.Text = Convert.ToString(myChar.dmgMeleePhysP[10]);
            gnNodeWeapPhysP.Text = Convert.ToString(myChar.dmgWeapPhysP[10]);
            gnNodeProjDmg.Text = Convert.ToString(myChar.dmgProjP[10]);

            gnHeadElemDmg.Text = Convert.ToString(myChar.dmgElemP[0]);
            gnChestElemDmg.Text = Convert.ToString(myChar.dmgElemP[1]);
            gnMainHElemDmg.Text = Convert.ToString(myChar.dmgElemP[2]);
            gnOffHElemDmg.Text = Convert.ToString(myChar.dmgElemP[3]);
            gnGlovesElemDmg.Text = Convert.ToString(myChar.dmgElemP[4]);
            gnBootsElemDmg.Text = Convert.ToString(myChar.dmgElemP[5]);
            gnBeltElemDmg.Text = Convert.ToString(myChar.dmgElemP[6]);
            gnRing1ElemDmg.Text = Convert.ToString(myChar.dmgElemP[7]);
            gnRing2ElemDmg.Text = Convert.ToString(myChar.dmgElemP[8]);
            gnAmuElemDmg.Text = Convert.ToString(myChar.dmgElemP[9]);
            gnNodeElemDmg.Text = Convert.ToString(myChar.dmgElemP[10]);

            gnHeadFireDmg.Text = Convert.ToString(myChar.dmgFireP[0]);
            gnChestFireDmg.Text = Convert.ToString(myChar.dmgFireP[1]);
            gnMainHFireDmg.Text = Convert.ToString(myChar.dmgFireP[2]);
            gnOffHFireDmg.Text = Convert.ToString(myChar.dmgFireP[3]);
            gnGlovesFireDmg.Text = Convert.ToString(myChar.dmgFireP[4]);
            gnBootsFireDmg.Text = Convert.ToString(myChar.dmgFireP[5]);
            gnBeltFireDmg.Text = Convert.ToString(myChar.dmgFireP[6]);
            gnRing1FireDmg.Text = Convert.ToString(myChar.dmgFireP[7]);
            gnRing2FireDmg.Text = Convert.ToString(myChar.dmgFireP[8]);
            gnAmuFireDmg.Text = Convert.ToString(myChar.dmgFireP[9]);
            gnNodeFireDmg.Text = Convert.ToString(myChar.dmgFireP[10]);

            gnHeadColdDmg.Text = Convert.ToString(myChar.dmgColdP[0]);
            gnChestColdDmg.Text = Convert.ToString(myChar.dmgColdP[1]);
            gnMainHColdDmg.Text = Convert.ToString(myChar.dmgColdP[2]);
            gnOffHColdDmg.Text = Convert.ToString(myChar.dmgColdP[3]);
            gnGlovesColdDmg.Text = Convert.ToString(myChar.dmgColdP[4]);
            gnBootsColdDmg.Text = Convert.ToString(myChar.dmgColdP[5]);
            gnBeltColdDmg.Text = Convert.ToString(myChar.dmgColdP[6]);
            gnRing1ColdDmg.Text = Convert.ToString(myChar.dmgColdP[7]);
            gnRing2ColdDmg.Text = Convert.ToString(myChar.dmgColdP[8]);
            gnAmuColdDmg.Text = Convert.ToString(myChar.dmgColdP[9]);
            gnNodeColdDmg.Text = Convert.ToString(myChar.dmgColdP[10]);

            gnHeadLightDmg.Text = Convert.ToString(myChar.dmgLightP[0]);
            gnChestLightDmg.Text = Convert.ToString(myChar.dmgLightP[1]);
            gnMainHLightDmg.Text = Convert.ToString(myChar.dmgLightP[2]);
            gnOffHLightDmg.Text = Convert.ToString(myChar.dmgLightP[3]);
            gnGlovesLightDmg.Text = Convert.ToString(myChar.dmgLightP[4]);
            gnBootsLightDmg.Text = Convert.ToString(myChar.dmgLightP[5]);
            gnBeltLightDmg.Text = Convert.ToString(myChar.dmgLightP[6]);
            gnRing1LightDmg.Text = Convert.ToString(myChar.dmgLightP[7]);
            gnRing2LightDmg.Text = Convert.ToString(myChar.dmgLightP[8]);
            gnAmuLightDmg.Text = Convert.ToString(myChar.dmgLightP[9]);
            gnNodeLightDmg.Text = Convert.ToString(myChar.dmgLightP[10]);

            gnHeadChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[0]);
            gnChestChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[1]);
            gnMainHChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[2]);
            gnOffHChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[3]);
            gnGlovesChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[4]);
            gnBootsChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[5]);
            gnBeltChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[6]);
            gnRing1ChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[7]);
            gnRing2ChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[8]);
            gnAmuChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[9]);
            gnNodeChaosDmg.Text = Convert.ToString(myChar.dmgChaosP[10]);

            //added damage

            gnHeadPhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[0]);
            gnChestPhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[1]);            
            gnGlovesPhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[4]);
            gnBootsPhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[5]);
            gnBeltPhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[6]);
            gnRing1PhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[7]);
            gnRing2PhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[8]);
            gnAmuPhysAddMin.Text = Convert.ToString(myChar.dmgPhysAddMin[9]);

            gnHeadPhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[0]);
            gnChestPhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[1]);            
            gnGlovesPhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[4]);
            gnBootsPhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[5]);
            gnBeltPhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[6]);
            gnRing1PhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[7]);
            gnRing2PhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[8]);
            gnAmuPhysAddMax.Text = Convert.ToString(myChar.dmgPhysAddMax[9]);

            gnHeadFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[0]);
            gnChestFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[1]);
            gnMainHFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[2]);
            gnOffHFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[3]);
            gnGlovesFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[4]);
            gnBootsFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[5]);
            gnBeltFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[6]);
            gnRing1FireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[7]);
            gnRing2FireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[8]);
            gnAmuFireAddMin.Text = Convert.ToString(myChar.dmgFireAddMin[9]);

            gnHeadFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[0]);
            gnChestFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[1]);
            gnMainHFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[2]);
            gnOffHFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[3]);
            gnGlovesFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[4]);
            gnBootsFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[5]);
            gnBeltFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[6]);
            gnRing1FireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[7]);
            gnRing2FireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[8]);
            gnAmuFireAddMax.Text = Convert.ToString(myChar.dmgFireAddMax[9]);

            gnHeadColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[0]);
            gnChestColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[1]);
            gnMainHColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[2]);
            gnOffHColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[3]);
            gnGlovesColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[4]);
            gnBootsColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[5]);
            gnBeltColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[6]);
            gnRing1ColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[7]);
            gnRing2ColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[8]);
            gnAmuColdAddMin.Text = Convert.ToString(myChar.dmgColdAddMin[9]);

            gnHeadColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[0]);
            gnChestColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[1]);
            gnMainHColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[2]);
            gnOffHColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[3]);
            gnGlovesColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[4]);
            gnBootsColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[5]);
            gnBeltColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[6]);
            gnRing1ColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[7]);
            gnRing2ColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[8]);
            gnAmuColdAddMax.Text = Convert.ToString(myChar.dmgColdAddMax[9]);

            gnHeadLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[0]);
            gnChestLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[1]);
            gnMainHLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[2]);
            gnOffHLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[3]);
            gnGlovesLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[4]);
            gnBootsLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[5]);
            gnBeltLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[6]);
            gnRing1LightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[7]);
            gnRing2LightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[8]);
            gnAmuLightAddMin.Text = Convert.ToString(myChar.dmgLightAddMin[9]);

            gnHeadLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[0]);
            gnChestLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[1]);
            gnMainHLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[2]);
            gnOffHLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[3]);
            gnGlovesLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[4]);
            gnBootsLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[5]);
            gnBeltLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[6]);
            gnRing1LightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[7]);
            gnRing2LightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[8]);
            gnAmuLightAddMax.Text = Convert.ToString(myChar.dmgLightAddMax[9]);

            gnHeadChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[0]);
            gnChestChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[1]);
            gnMainHChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[2]);
            gnOffHChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[3]);
            gnGlovesChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[4]);
            gnBootsChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[5]);
            gnBeltChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[6]);
            gnRing1ChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[7]);
            gnRing2ChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[8]);
            gnAmuChaosAddMin.Text = Convert.ToString(myChar.dmgChaosAddMin[9]);

            gnHeadChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[0]);
            gnChestChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[1]);
            gnMainHChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[2]);
            gnOffHChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[3]);
            gnGlovesChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[4]);
            gnBootsChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[5]);
            gnBeltChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[6]);
            gnRing1ChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[7]);
            gnRing2ChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[8]);
            gnAmuChaosAddMax.Text = Convert.ToString(myChar.dmgChaosAddMax[9]);
            

            //misc damage
            txtMainHAPS.Text = Convert.ToString(myChar.mainHAPS);
            txtOffHAPS.Text = Convert.ToString(myChar.offHAPS);
            txtMainHPhysMin.Text = Convert.ToString(myChar.mainHPhysMin);
            txtMainHPhysMax.Text = Convert.ToString(myChar.mainHPhysMax);
            txtOffHPhysMin.Text = Convert.ToString(myChar.offHPhysMin);
            txtOffHPhysMax.Text = Convert.ToString(myChar.offHPhysMax);
            txtMainHCrit.Text = Convert.ToString(myChar.mainHCrit);
            txtOffHCrit.Text = Convert.ToString(myChar.offHCrit);
            txtFacebreaker.Text = Convert.ToString(myChar.facebreaker);

            txtIgniteChance.Text = Convert.ToString(myChar.igniteChance);
            txtIgniteDuration.Text = Convert.ToString(myChar.igniteDuration);
            txtBurningDmg.Text = Convert.ToString(myChar.igniteDamage);
            txtShockChance.Text = Convert.ToString(myChar.shockChance);
            txtShockDuration.Text = Convert.ToString(myChar.shockDuration);
            txtFreezeChance.Text = Convert.ToString(myChar.freezeChance);
            txtFreezeDuration.Text = Convert.ToString(myChar.freezeDuration);
            txtChillDuration.Text = Convert.ToString(myChar.chillDuration);
            txtDOTDmg.Text = Convert.ToString(myChar.dotDamage);
            txtTrapDmg.Text = Convert.ToString(myChar.trapDamage);
            txtAreaSize.Text = Convert.ToString(myChar.areaSize);
            txtAreaDmg.Text = Convert.ToString(myChar.areaDamage);


            //MISC
            gnHeadIIR.Text = Convert.ToString(myChar.IIRAdd[0]);
            gnMainHIIR.Text = Convert.ToString(myChar.IIRAdd[2]);
            gnOffHIIR.Text = Convert.ToString(myChar.IIRAdd[3]);
            gnGlovesIIR.Text = Convert.ToString(myChar.IIRAdd[4]);
            gnBootsIIR.Text = Convert.ToString(myChar.IIRAdd[5]);
            gnBeltIIR.Text = Convert.ToString(myChar.IIRAdd[6]);
            gnRing1IIR.Text = Convert.ToString(myChar.IIRAdd[7]);
            gnRing2IIR.Text = Convert.ToString(myChar.IIRAdd[8]);
            gnAmuIIR.Text = Convert.ToString(myChar.IIRAdd[9]);

            gnHeadIIQ.Text = Convert.ToString(myChar.IIQAdd[0]);
            gnMainHIIQ.Text = Convert.ToString(myChar.IIQAdd[2]);
            gnOffHIIQ.Text = Convert.ToString(myChar.IIQAdd[3]);
            gnGlovesIIQ.Text = Convert.ToString(myChar.IIQAdd[4]);
            gnBootsIIQ.Text = Convert.ToString(myChar.IIQAdd[5]);
            gnBeltIIQ.Text = Convert.ToString(myChar.IIQAdd[6]);
            gnRing1IIQ.Text = Convert.ToString(myChar.IIQAdd[7]);
            gnRing2IIQ.Text = Convert.ToString(myChar.IIQAdd[8]);
            gnAmuIIQ.Text = Convert.ToString(myChar.IIQAdd[9]);

            gnHeadAuraRes.Text = Convert.ToString(myChar.reducedReserve[0]);
            gnNodeAuraRes.Text = Convert.ToString(myChar.reducedReserve[10]);

            gnOffHAuraEff.Text = Convert.ToString(myChar.auraStrength[3]);
            gnNodeAuraEff.Text = Convert.ToString(myChar.auraStrength[10]);

            gnNodeBuffStr.Text = Convert.ToString(myChar.buffStrength[10]);
            gnNodeBuffDur.Text = Convert.ToString(myChar.buffDuration[10]);
            gnNodeSkillDur.Text = Convert.ToString(myChar.skillDuration[10]);

            gnMainHMinLife.Text = Convert.ToString(myChar.minionLife[2]);
            gnOffHMinLife.Text = Convert.ToString(myChar.minionLife[3]);
            gnAmuMinLife.Text = Convert.ToString(myChar.minionLife[9]);
            gnNodeMinLife.Text = Convert.ToString(myChar.minionLife[10]);

            gnMainHMinDmg.Text = Convert.ToString(myChar.minionDamage[2]);
            gnOffHMinDmg.Text = Convert.ToString(myChar.minionDamage[3]);
            gnAmuMinDmg.Text = Convert.ToString(myChar.minionDamage[9]);
            gnNodeMinDmg.Text = Convert.ToString(myChar.minionDamage[10]);

            gnMainHMinSpd.Text = Convert.ToString(myChar.minionSpeed[2]);
            gnOffHMinSpd.Text = Convert.ToString(myChar.minionSpeed[3]);
            gnAmuMinSpd.Text = Convert.ToString(myChar.minionSpeed[9]);
           
            // SET CRIT VALUES - 
            //NOTE MAKE SURE TO ACTIVATE CELLS!
            gnHeadCrit.Text = Convert.ToString(myChar.critP[0]);
            gnChestCrit.Text = Convert.ToString(myChar.critP[1]);
            gnMainHCrit.Text = Convert.ToString(myChar.critP[2]);
            gnOffHCrit.Text = Convert.ToString(myChar.critP[3]);
            gnGlovesCrit.Text = Convert.ToString(myChar.critP[4]);
            gnBootsCrit.Text = Convert.ToString(myChar.critP[5]);
            gnBeltCrit.Text = Convert.ToString(myChar.critP[6]);
            gnRing1Crit.Text = Convert.ToString(myChar.critP[7]);
            gnRing2Crit.Text = Convert.ToString(myChar.critP[8]);
            gnAmuCrit.Text = Convert.ToString(myChar.critP[9]);
            gnNodeCrit.Text = Convert.ToString(myChar.critP[10]);

            gnHeadCritM.Text = Convert.ToString(myChar.critMultP[0]);
            gnChestCritM.Text = Convert.ToString(myChar.critMultP[1]);
            gnMainHCritM.Text = Convert.ToString(myChar.critMultP[2]);
            gnOffHCritM.Text = Convert.ToString(myChar.critMultP[3]);
            gnGlovesCritM.Text = Convert.ToString(myChar.critMultP[4]);
            gnBootsCritM.Text = Convert.ToString(myChar.critMultP[5]);
            gnBeltCritM.Text = Convert.ToString(myChar.critMultP[6]);
            gnRing1CritM.Text = Convert.ToString(myChar.critMultP[7]);
            gnRing2CritM.Text = Convert.ToString(myChar.critMultP[8]);
            gnAmuCritM.Text = Convert.ToString(myChar.critMultP[9]);
            gnNodeCritM.Text = Convert.ToString(myChar.critMultP[10]);

            gnHeadSpellCrit.Text = Convert.ToString(myChar.critSpellP[0]);
            gnChestSpellCrit.Text = Convert.ToString(myChar.critSpellP[1]);
            gnMainHSpellCrit.Text = Convert.ToString(myChar.critSpellP[2]);
            gnOffHSpellCrit.Text = Convert.ToString(myChar.critSpellP[3]);
            gnGlovesSpellCrit.Text = Convert.ToString(myChar.critSpellP[4]);
            gnBootsSpellCrit.Text = Convert.ToString(myChar.critSpellP[5]);
            gnBeltSpellCrit.Text = Convert.ToString(myChar.critSpellP[6]);
            gnRing1SpellCrit.Text = Convert.ToString(myChar.critSpellP[7]);
            gnRing2SpellCrit.Text = Convert.ToString(myChar.critSpellP[8]);
            gnAmuSpellCrit.Text = Convert.ToString(myChar.critSpellP[9]);
            gnNodeSpellCrit.Text = Convert.ToString(myChar.critSpellP[10]);

            gnHeadSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[0]);
            gnChestSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[1]);
            gnMainHSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[2]);
            gnOffHSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[3]);
            gnGlovesSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[4]);
            gnBootsSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[5]);
            gnBeltSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[6]);
            gnRing1SpellCritM.Text = Convert.ToString(myChar.critMultSpellP[7]);
            gnRing2SpellCritM.Text = Convert.ToString(myChar.critMultSpellP[8]);
            gnAmuSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[9]);
            gnNodeSpellCritM.Text = Convert.ToString(myChar.critMultSpellP[10]);

            gnHeadAtkCrit.Text = Convert.ToString(myChar.critWeaponP[0]);
            gnChestAtkCrit.Text = Convert.ToString(myChar.critWeaponP[1]);
            gnMainHAtkCrit.Text = Convert.ToString(myChar.critWeaponP[2]);
            gnOffHAtkCrit.Text = Convert.ToString(myChar.critWeaponP[3]);
            gnGlovesAtkCrit.Text = Convert.ToString(myChar.critWeaponP[4]);
            gnBootsAtkCrit.Text = Convert.ToString(myChar.critWeaponP[5]);
            gnBeltAtkCrit.Text = Convert.ToString(myChar.critWeaponP[6]);
            gnRing1AtkCrit.Text = Convert.ToString(myChar.critWeaponP[7]);
            gnRing2AtkCrit.Text = Convert.ToString(myChar.critWeaponP[8]);
            gnAmuAtkCrit.Text = Convert.ToString(myChar.critWeaponP[9]);
            gnNodeAtkCrit.Text = Convert.ToString(myChar.critWeaponP[10]);

            gnHeadAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[0]);
            gnChestAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[1]);
            gnMainHAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[2]);
            gnOffHAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[3]);
            gnGlovesAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[4]);
            gnBootsAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[5]);
            gnBeltAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[6]);
            gnRing1AtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[7]);
            gnRing2AtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[8]);
            gnAmuAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[9]);
            gnNodeAtkCritM.Text = Convert.ToString(myChar.critMultWeaponP[10]);


            

            this.calcLoadWeapon1();

            this.updateStr();
            this.updateDex();
            this.updateInt();

            // this.updateArmor(); //don't need to call this since updateEvade updates armor
            this.updateLife(); // also updates regen
            this.updateShield(); // updates ES, which update mana->mana regen. updates evade, which updates armor
            //this.updateMana(); // also updates mana regen
            //this.updateEvade(); // also updates armor
            //this.updateES();            
            this.updateResists();
            this.updateMisc();

            //--------AURAS------------------------------------------
            this.refreshAllAuraText();
            this.updateDPS();

        }
        /*--------------------------------------CALCULATORS--------------
         * 
         * -------------------------------------------------------------*/
        public void btnDefCalc_Click(object sender, EventArgs e)
        {
            calcDefensep();
        }

        public void calcDefensep()
        {
            decimal physdmg, armor, reducep;
            double acc,evade, evadep, temp;
            acc = Convert.ToDouble(txtDefEnemyAcc.Text);
            physdmg = Convert.ToDecimal(txtDefPhysDmg.Text);
            evade = Convert.ToDouble(txtDefEvade.Text);
            armor = Convert.ToDecimal(txtDefArmor.Text);

            if (physdmg > 0 && armor > 0)
                reducep = armor / (armor + (12 * physdmg)) * 100;
            else
                reducep = 0;

            if (acc > 0 && evade > 0)
            {

                temp = Math.Pow((evade / 4.0d), 8.0d/10.0d);
                evadep = 1 - (acc / (acc + temp));
                //MessageBox.Show("acc :" + acc + " evade/4.0: " + evade / 4.0 + " temp: " + temp+" evadep: "+evadep);
                if (evadep < .05) evadep = .05;
                if (evadep > .95) evadep = .95;
                evadep = evadep * 100;
            }
            else
                evadep = 0;
            txtDefEvadeP.Text = evadep.ToString("00.0") + "%";
            txtDefReduceP.Text = reducep.ToString("00.0") + "%";

        }

        public void btnCalcReduction_Click(object sender, EventArgs e)
        {
            calcDamageReduction();
        }

        public void calcDamageReduction()
        {
            decimal physdealt1, physdealt2, physdealt3, armor, mana, charges, armordmgreduction, physreduction, aaphys, aafire, momp;
            decimal chaosconv, lightconv, fireconv, chaosres, lightres, fireres;
            decimal chaosdealt, lightdealt, firedealt, totaldealt, dmgasmana, dmgmanaoverflow, dmgaslife;
            physdealt1 = Convert.ToDecimal(txtDRPhysDealt1.Text);
            armor = Convert.ToDecimal(txtDRArmor.Text);
            mana = Convert.ToDecimal(txtDRMana.Text);
            charges = Convert.ToDecimal(txtDREndCharges.Text);
            aaphys = Convert.ToDecimal(txtDRAAPhys.Text);
            aafire = Convert.ToDecimal(txtDRAAFire.Text);
            momp = Convert.ToDecimal(txtDRMoMP.Text)/100m;
            chaosconv = Convert.ToDecimal(txtDRChaosConv.Text)/100m;
            fireconv = Convert.ToDecimal(txtDRFireConv.Text)/100m;
            lightconv = Convert.ToDecimal(txtDRLightConv.Text)/100m;
            chaosres = Convert.ToDecimal(txtDRChaosRes.Text)/100m;
            fireres = Convert.ToDecimal(txtDRFireRes.Text)/100m;
            lightres = Convert.ToDecimal(txtDRLightRes.Text)/100m;
            physdealt2 = physdealt1 * (1 - chaosconv - fireconv - lightconv);
            txtDRPhysDealt2.Text = physdealt2.ToString("0");
            armordmgreduction = Math.Min(armor / (armor + (12 * physdealt2)),.90m);
            txtDRArmorPhysReduction.Text = (100*armordmgreduction).ToString("00.0") + "%";
            physreduction = Math.Min(.90m,armordmgreduction + (4*charges)/100m);
            //MessageBox.Show("armrred: " + armordmgreduction + " charges: " + charges+ " physred: "+physreduction);
            txtDRPhysReduction.Text = (100*physreduction).ToString("00.0") + "%";

            physdealt3 = Math.Max((physdealt2 * (1 - physreduction)) - aaphys,0);
            txtDRPhysDealt3.Text = physdealt3.ToString("0");
            chaosdealt = (physdealt1 * chaosconv) * (1-chaosres);
            firedealt = Math.Max(((physdealt1 * fireconv) * (1-fireres)) - aafire,0);
            lightdealt = (physdealt1 * lightconv) * (1-lightres);
            txtDRChaosDealt.Text = chaosdealt.ToString("0");
            txtDRFireDealt.Text = firedealt.ToString("0");
            txtDRLightDealt.Text = lightdealt.ToString("0");
            totaldealt = physdealt3 + chaosdealt + firedealt + lightdealt;
            txtDRTotalDealt.Text = totaldealt.ToString("0");
            dmgasmana = totaldealt * momp;
            if (dmgasmana > mana)
            {
                dmgmanaoverflow = dmgasmana - mana;
                dmgasmana = mana;
            }
            else
                dmgmanaoverflow = 0;
            //MessageBox.Show("dmgasmana: " + dmgasmana + " dmgoverflow: " + dmgmanaoverflow);
            dmgaslife = totaldealt - dmgasmana;
            txtDRDmgAsMana.Text = dmgasmana.ToString("0");
            txtDRDmgAsLife.Text = dmgaslife.ToString("0");
        }

        public void btnCompareWeapons_Click(object sender, EventArgs e)
        {
            calcCompareWeapons();
        }
        public void btnLoadMain_Click(object sender, EventArgs e)
        {
            calcLoadWeapon1();
        }
        public void calcLoadWeapon1()
        {
            calcCmpPhysMin1.Text = myChar.mainHPhysMin.ToString();
            calcCmpPhysMax1.Text = myChar.mainHPhysMax.ToString();
            calcCmpFireMin1.Text = myChar.dmgFireAddMin[2].ToString();
            calcCmpFireMax1.Text = myChar.dmgFireAddMax[2].ToString();
            calcCmpColdMin1.Text = myChar.dmgColdAddMin[2].ToString();
            calcCmpColdMax1.Text = myChar.dmgColdAddMax[2].ToString();
            calcCmpLightMin1.Text = myChar.dmgLightAddMin[2].ToString();
            calcCmpLightMax1.Text = myChar.dmgLightAddMax[2].ToString();
            calcCmpChaosMin1.Text = myChar.dmgChaosAddMin[2].ToString();
            calcCmpChaosMax1.Text = myChar.dmgChaosAddMax[2].ToString();
            calcCmpAPS1.Text = myChar.mainHAPS.ToString();
            calcCmpCrit1.Text = myChar.mainHCrit.ToString();
        }

        public void calcCompareWeapons()
        {
            decimal physmin1, physmax1, firemin1, firemax1, coldmin1, coldmax1, lightmin1, lightmax1, chaosmin1, chaosmax1, elemin1, elemax1, aps1, crit1;
            decimal physmin2, physmax2, firemin2, firemax2, coldmin2, coldmax2, lightmin2, lightmax2, chaosmin2, chaosmax2, elemin2, elemax2, aps2, crit2;
            decimal pdps1, pdps2, edps1, edps2, dps1, dps2, critdps1, critdps2;
            decimal tdps1, tdps2;

            decCheckBox(calcCmpPhysMin1, out physmin1);
            decCheckBox(calcCmpPhysMin2, out physmin2);
            decCheckBox(calcCmpPhysMax1, out physmax1);
            decCheckBox(calcCmpPhysMax2, out physmax2);
            decCheckBox(calcCmpFireMin1, out firemin1);
            decCheckBox(calcCmpFireMax1, out firemax1);
            decCheckBox(calcCmpColdMin1, out coldmin1);
            decCheckBox(calcCmpColdMax1, out coldmax1);
            decCheckBox(calcCmpLightMin1, out lightmin1);
            decCheckBox(calcCmpLightMax1, out lightmax1);
            decCheckBox(calcCmpChaosMin1, out chaosmin1);
            decCheckBox(calcCmpChaosMax1, out chaosmax1);
            decCheckBox(calcCmpFireMin2, out firemin2);
            decCheckBox(calcCmpFireMax2, out firemax2);
            decCheckBox(calcCmpColdMin2, out coldmin2);
            decCheckBox(calcCmpColdMax2, out coldmax2);
            decCheckBox(calcCmpLightMin2, out lightmin2);
            decCheckBox(calcCmpLightMax2, out lightmax2);
            decCheckBox(calcCmpChaosMin2, out chaosmin2);
            decCheckBox(calcCmpChaosMax2, out chaosmax2);
            elemin1 = firemin1 + coldmin1 + lightmin1 + chaosmin1;
            elemin2 = firemin2 + coldmin2 + lightmin2 + chaosmin2;
            elemax1 = firemax1 + coldmax1 + lightmax1 + chaosmax1;
            elemax2 = firemax2 + coldmax2 + lightmax2 + chaosmax2;
            decCheckBox(calcCmpAPS1, out aps1);
            decCheckBox(calcCmpAPS2, out aps2);
            decCheckBox(calcCmpCrit1, out crit1);
            decCheckBox(calcCmpCrit2, out crit2);

            pdps1 = (physmin1 + physmax1) / 2 * aps1;
            calcCmppDPS1.Text = pdps1.ToString("0");
            pdps2 = (physmin2 + physmax2) / 2 * aps2;
            calcCmppDPS2.Text = pdps2.ToString("0");
            edps1 =  (elemin1 + elemax1) / 2 * aps1;
            calcCmpeDPS1.Text = edps1.ToString("0");
            edps2 = (elemin2 + elemax2) / 2 * aps2;
            calcCmpeDPS2.Text = edps2.ToString("0");
            dps1 = (((physmin1 + physmax1) / 2) + ((elemin1 + elemax1) / 2)) * aps1;
            calcCmpDPS1.Text = dps1.ToString("0");
            dps2 = (((physmin2 + physmax2) / 2) + ((elemin2 + elemax2) / 2)) * aps2;
            calcCmpDPS2.Text = dps2.ToString("0");
            critdps1 = dps1 * (1 + (crit1 / 100));
            calcCmpCritDPS1.Text = critdps1.ToString("0");
            critdps2 = dps2 * (1 + (crit2 / 100));
            calcCmpCritDPS2.Text = critdps2.ToString("0");

            calcGearedAPS1.Text = (aps1 * (1 + ((myChar.attackSpeed.Sum() + myChar.decAuraEffects("Haste")[1]) /100))).ToString("0.00");
            calcGearedAPS2.Text = (aps2 * (1 + ((myChar.attackSpeed.Sum() + myChar.decAuraEffects("Haste")[1]) / 100))).ToString("0.00");
            calcGearedCrit1.Text = (crit1 * (1+ (myChar.critP.Sum()+myChar.critWeaponP.Sum())/100)).ToString("0.00");
            calcGearedCrit2.Text = (crit2 * (1 + (myChar.critP.Sum() + myChar.critWeaponP.Sum()) / 100)).ToString("0.00");

            //MAIN HAND
            tdps1 = calcWeaponDPS(physmin1, physmax1, firemin1, firemax1, coldmin1, coldmax1,
                                                lightmin1, lightmax1, chaosmin1, chaosmax1, Convert.ToDecimal(calcGearedAPS1.Text));
            calcGearedDPS1.Text = tdps1.ToString("0");            
            tdps1 = tdps1 * (1+(Convert.ToDecimal(calcGearedCrit1.Text) / 100));
            calcGearedCritDPS1.Text = tdps1.ToString("0");

            //OFF HAND
            if (physmin2 > 0 || firemin2 > 0 || coldmin2 > 0 || lightmin2 > 0 || chaosmin2 > 0)
            {
                tdps2 = calcWeaponDPS(physmin2, physmax2, firemin2, firemax2, coldmin2, coldmax2,
                                                                lightmin2, lightmax2, chaosmin2, chaosmax2, Convert.ToDecimal(calcGearedAPS2.Text));
                calcGearedDPS2.Text = tdps2.ToString("0");
                tdps2 = tdps2 * (1 + (Convert.ToDecimal(calcGearedCrit2.Text) / 100));
                calcGearedCritDPS2.Text = tdps2.ToString("0");
            }

        }

        public decimal calcWeaponDPS(decimal physmin, decimal physmax, decimal firemin, decimal firemax, decimal coldmin, decimal coldmax,
                                    decimal lightmin, decimal lightmax, decimal chaosmin, decimal chaosmax, decimal APS)
        {
            decimal tphysmin, tphysmax, tfiremin, tfiremax, tcoldmin, tcoldmax, tlightmin, tlightmax, tchaosmin, tchaosmax;
            decimal tdps1, tdps2, tinc;

            // weapon range + NONWEAPON added min-max  * INCREASED PHYS
            tphysmin = (physmin + myChar.dmgPhysAddMin.Sum());
            tphysmax = (physmax + myChar.dmgPhysAddMax.Sum());

            tinc = myChar.dmgPhysP.Sum() + Convert.ToDecimal(myChar.strStatsPhys());            
            tinc = tinc / 100;
            tinc = 1 + tinc;

            tphysmin = tphysmin * tinc;
            tphysmax = tphysmax * tinc;
            //MessageBox.Show("Increased Phys: " + tphysmin + "-" + tphysmax);


            tfiremin = firemin + myChar.dmgFireAddMin.Sum() + myChar.decAuraEffects("Anger")[0];
            tfiremax = firemax + myChar.dmgFireAddMax.Sum() + myChar.decAuraEffects("Anger")[1];
            //if(tfiremin > 0)                 MessageBox.Show("Fire: " + tfiremin + "-" + tfiremax);    
            tfiremin = tfiremin * (1 + (myChar.dmgFireP.Sum() + myChar.dmgElemP.Sum()) / 100);
            tfiremax = tfiremax * (1 + (myChar.dmgFireP.Sum() + myChar.dmgElemP.Sum()) / 100);
            //if (tfiremin > 0)                 MessageBox.Show("Increased Fire: " + tfiremin + "-" + tfiremax);    
            tcoldmin = coldmin + myChar.dmgColdAddMin.Sum() + tphysmin * (myChar.decAuraEffects("Hatred")[0] / 100);
            tcoldmax = coldmax + myChar.dmgColdAddMax.Sum() + tphysmax * (myChar.decAuraEffects("Hatred")[0] / 100);
            tcoldmin = tcoldmin * (1 + (myChar.dmgColdP.Sum() + myChar.dmgElemP.Sum()) / 100);
            tcoldmax = tcoldmax * (1 + (myChar.dmgColdP.Sum() + myChar.dmgElemP.Sum()) / 100);
            tlightmin = lightmin + myChar.dmgLightAddMin.Sum() + myChar.decAuraEffects("Wrath")[0];
            tlightmax = lightmax + myChar.dmgLightAddMax.Sum() + myChar.decAuraEffects("Wrath")[1];
            tlightmin = tlightmin * (1 + (myChar.dmgLightP.Sum() + myChar.dmgElemP.Sum()) / 100);
            tlightmax = tlightmax * (1 + (myChar.dmgLightP.Sum() + myChar.dmgElemP.Sum()) / 100);
            tchaosmin = chaosmin + myChar.dmgChaosAddMin.Sum();
            tchaosmax = chaosmax + myChar.dmgChaosAddMax.Sum();
            tchaosmin = tchaosmin * (1 + (myChar.dmgChaosP.Sum()) / 100);
            tchaosmax = tchaosmax * (1 + (myChar.dmgChaosP.Sum()) / 100);

            tdps1 = tphysmin + tfiremin + tcoldmin + tlightmin + tchaosmin;
            //MessageBox.Show("P:"+tphysmin +" F:"+tfiremin +" C:"+tcoldmin +" L:"+tlightmin +" CH:"+tchaosmin);
            tdps2 = tphysmax + tfiremax + tcoldmax + tlightmax + tchaosmax;
            //MessageBox.Show("Damage: " + tdps1 + "-" + tdps2);    
            tdps1 = (tdps1 + tdps2) / 2;
            tdps1 = tdps1 * APS;
            return tdps1;
        }
        // COC CALC

        private void cocButtons_Leave(object sender, EventArgs e)
        {
            calcCoCDPS();
        }

        private void calcCoCDPS()
        {
            decimal ttdps, ttat, critch, cocch;
            int multistrike;
            decimal aps, cycles, spellch, spellsec, spelldps;
            ttdps = Convert.ToDecimal(cocTTDPS.Text);
            ttat = Convert.ToDecimal(cocTTAttackTime.Text);
            aps = 1 / ttat;
            cocAPS.Text = aps.ToString("0.00");
            if (cocchkMultistrike.Checked == true)
            {
                multistrike = 1;
                cycles = aps / 3;
            }
            else
            {
                multistrike = 0;
                cycles = aps;
            }
            cocMSCycles.Text = cycles.ToString("0.00");
            critch = Convert.ToDecimal(cocCritChance.Text)/100;
            cocch = Convert.ToDecimal(cocCoCChance.Text)/100;
            spellch = critch * cocch;
            cocChanceSpell.Text = spellch.ToString("0.00") + "%";
            spellsec = cycles * spellch;
            cocSpellSec.Text = spellsec.ToString("0.00");
            spelldps = spellsec * ttdps;
            cocSpellDPS.Text = spelldps.ToString("0.0");
        }
        // MF CALCS
        private void btnMF_Click(object sender, EventArgs e)
        {
            calcMF();
        }

        private void calcMF()
        {
            decimal drops, pmagic, prare, puniq, diminish, temp;
            decimal[] IIR, IIQ, nmag, nrare, nuniq;
            decCheckBox(txtMFDrops, out drops);
            decCheckBox(txtMagicP, out pmagic);
            pmagic = pmagic/100;
            decCheckBox(txtMFRareP, out prare);
            prare = prare/100;
            decCheckBox(txtMFUniqP, out puniq);
            puniq = puniq/100;
            IIR = new decimal[] { 0, 0, 0, 0 };
            IIQ = new decimal[] { 0, 0, 0, 0 };
            nmag = new decimal[] { 0, 0, 0, 0 };
            nrare = new decimal[] { 0, 0, 0, 0 };
            nuniq = new decimal[] { 0, 0, 0, 0 };
            decCheckBox(txtMFIIR1, out IIR[0]);
            decCheckBox(txtMFIIR2, out IIR[1]);
            decCheckBox(txtMFIIR3, out IIR[2]);
            decCheckBox(txtMFIIR4, out IIR[3]);
            decCheckBox(txtMFIIQ1, out IIQ[0]);
            decCheckBox(txtMFIIQ2, out IIQ[1]);
            decCheckBox(txtMFIIQ3, out IIQ[2]);
            decCheckBox(txtMFIIQ4, out IIQ[3]);
            //number of magic items = drops * pmagic * (1+IIQ[x]/100) - rares - uniques
            //number of rares = (prare *(1+ IIR/100)) * (# magic)  - nuniques
            //NOTE THAT puniq is the pecentage of rares that are unique, so 1% of rares -> uniq default
            //nuniq = (puniq * nrare)
            //diminish = 1 - (.00066*rarity) = x%, then final rarity = rarity * x%
            // IIR IS AN INCREASE!! it adds to some existing value!!
            // so we're going to try base chance PLUS diminished IIR, and reduce that by a factor of 10 for rare, uniq
            for (int n = 0; n < 4; n++)
            {
                diminish = 1 - (((decimal).00085 * IIR[n]) + (IIR[n]*IIR[n])/5000000) ;
                if (diminish < (decimal).5) diminish = (decimal).5;
                temp = pmagic + (IIR[n] * diminish)/1000;
               // MessageBox.Show("IIR[n]: "+IIR[n]+" pmagic "+pmagic+" diminish:" + diminish+" temp: "+temp);
                nmag[n] = (drops * (1 + (IIQ[n] / 100))) * temp;
                temp = prare + (IIR[n] * diminish) / 10000;
                nrare[n] = nmag[n] * temp;//(prare *  (1 + (IIR[n] / 100)*diminish));  // WEIRD RARITY MODEL b/c predicted doesn't match reality
                temp = puniq + (IIR[n] * diminish) / 100000;
                nuniq[n] = nrare[n] * puniq; // (puniq * (1 + (IIR[n] / 100) * diminish));                
                nmag[n] = nmag[n] - nrare[n]; // since rares are upgraded magics
                nrare[n] = nrare[n] - nuniq[n]; // since uniques are upgraded rares
            }
            
            txtMFMagic1.Text = nmag[0].ToString("0");
            txtMFRares1.Text = nrare[0].ToString("0");
            txtMFUniques1.Text = nuniq[0].ToString("0");

            txtMFMagic2.Text = nmag[1].ToString("0");
            txtMFRares2.Text = nrare[1].ToString("0");
            txtMFUniques2.Text = nuniq[1].ToString("0");

            txtMFMagic3.Text = nmag[2].ToString("0");
            txtMFRares3.Text = nrare[2].ToString("0");
            txtMFUniques3.Text = nuniq[2].ToString("0");

            txtMFMagic4.Text = nmag[3].ToString("0");
            txtMFRares4.Text = nrare[3].ToString("0");
            txtMFUniques4.Text = nuniq[3].ToString("0");
        }

    }
}
